Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* remove all listeners unconditionally if neither event type nor callback has been given, remove all listeners regardless of capture value. This avoid iterating through the array twice for cleaning up, once for capture=true and once for capture=false. * added comments on unbinding all listeners * allow unbinding en masse by capture setting added checks of boolean param in unbind function to allow the following scenarios 1. removing all listeners: $.unbind(elem) 2. removing all listeners with capture option set to false: $.unbind(elem, undefined, false) 3. removing all listeners with capture option set to true: $.unbind(elem, undefined, true) * added examples of unbinding by capture setting * modified comments on Bliss Shy, bind and unbind * corrected a typo in parentheses should have used local editor and git. * updated unbind examples somehow after function overloading and minification, $.unbind(elem,'', false) and $.unbind(elem,'', true) work as expected. The type param placeholder needs to be an empty string to represent all event types. The types placeholder can not be undefined. * fixed memory leak bug [#221] when data arrays exist in $.listeners, always go through data arrays to clean up and remove event listeners.
- Loading branch information