LP#1086458: add class to manage event listeners
authorGalen Charlton <gmc@esilibrary.com>
Thu, 24 Jan 2013 16:56:30 +0000 (11:56 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 24 Jan 2013 20:43:59 +0000 (15:43 -0500)
commita8fd6882d34917e6501da1fc929dcf110d3f0ecd
treefa7d2de923dd08949af7cdb3d6e5492b5ba34b6b
parent00d35fcc7c586fb7ac8483d6dc0c2423458ffe26
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>
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js