Ticket #2518 (closed feature: duplicate)
Base control: Automatically cancels the registration of listeners and destroys events.
|Reported by:||jorix||Owned by:||jorix|
This ticket is an improved management of events and listeners in controls. With these modifications in controls no needs to add properties to store instances of events for call “un” methods at controls destruction.
- The new addListener method keeps the pairs of events and their eventListeners in a array. And calls the “on” events method for the listeners.
- Allows setting the listener only active if the control is active. Using option “whenActive” to true.
- New “removeListeners” method calls “un” method of events and destroys it if autoDestroy option is set to true. This occurs only when events have no listeners.
- The method “removeListeners” is called in destroys controls.
- Patch of control.js with these new features.
- Examples of using the new methods in:
SVN Revision Number: 10094