View Full Version : Events: addEvent for adding, ... for removing?
2 Jul 2012, 5:25 AM
I know there is a function "un" resp. "removeListener" for removing event handler, but how do I remove the event registered with "addEvent"?
2 Jul 2012, 5:34 AM
You can't remove an event.
Why would you want to?
2 Jul 2012, 6:02 AM
Short: I just want to.
Long: If I dont need certain events anymore in my app, I want to remove them, so that they cannot be used anymore.
Why is that impossible?
2 Jul 2012, 7:12 AM
this.hasListeners.click = 0;
As long as you know it has no listeners attached.
I can't see the point though.
2 Jul 2012, 7:23 AM
If you are looking to stop actions you might also want to try
which Prevents the browser from executing the default action. Use the method isDefaultPrevented to know whether this method was ever called (on that event object).or
which stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.
6 Jul 2012, 12:54 AM
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.