You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.
There are cases where multiple things on the screen may init a new Shake(). For example, if a CMS has various components which the editor adds, and more than one of them want to enable shake detection.
At the moment, this causes the shake-event to trigger for each initialized Shake(), so code outside "my" scope could cause the shake-event to occur multiple times.
I believe Shake() should somehow either
check if it's already running, and return the running instance
OR manage a list of registered Shakes and remove one
OR change the concept (or offer the alternative) to use a callback - there seems to be a fork which does this; shake could just offer both: JonWallsten@3989b49
The text was updated successfully, but these errors were encountered:
How many pieces of code do you have running on one page that all need to respond to a shake event in different ways? What are they all doing? I'm curious if this is a common need.
When I get round to it, changing this plugin to use a callback is something I plan on doing if that helps.
So the scenario I'm talking about is a web-platform scenario which may have components from multiple vendors - let's say a CMS component which uses shake to show buttons (http://2sxc.org/en/blog/post/introducing-shake-mobile-content-editing-just-turned-sexy) and another one which maybe will use shake do something with an image gallery. Now both vendors don't know about each other, but when the CMS-owner adds both components, both would start a Shake() and this would double-trigger the event.
There are cases where multiple things on the screen may init a
new Shake()
. For example, if a CMS has various components which the editor adds, and more than one of them want to enable shake detection.At the moment, this causes the shake-event to trigger for each initialized
Shake()
, so code outside "my" scope could cause the shake-event to occur multiple times.I believe Shake() should somehow either
The text was updated successfully, but these errors were encountered: