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>
Thu, 28 Feb 2013 03:41:04 +0000 (22:41 -0500)
commit429f9203230f0f5073f706643528b5495c272302
tree51b2736c692cb322a3c546eb6a003e59f90b40df
parent38de53539a7d7469eed976546d2ed060956b173f
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