]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1086458: add class to manage event listeners
authorGalen Charlton <gmc@esilibrary.com>
Thu, 24 Jan 2013 16:56:30 +0000 (11:56 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 4 Mar 2013 19:50:25 +0000 (14:50 -0500)
commitf8be2b0a1d71ee8b7d565eb7b838bd58e87a3569
treebbf025ba610d1fd73cc2813a02654ea8f9d6b38a
parentaccd12854102132b2a9b6e03c53512d0fbdd190d
LP#1086458: add class to manage event listeners

EventListenerList allows one to maintain a list
of event listeners, then remove them all when it's
time to clean up a window.

Usage is:

var list = new EventListenerList();
// attach an event listener
list.add(node, 'command', function(ev) { alert('BOO!'); }, false);
...
// get rid of them
list.removeAll();

Based on an idea by Jason Etheridge.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js