home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
fil7320CA93A97D36234D783AE8B4A0EB0A
< prev
next >
Wrap
Text File
|
2010-07-12
|
771b
|
33 lines
XB.UI.EventListener = function(element, type, listener, capture, context) {
this.element = element;
this.type = type;
this.capture = capture;
this.status = false;
if (context)
this.handler = function(e) {
listener.call(context, e);
}
else
this.handler = listener;
this.enable();
}
XB.UI.EventListener.prototype = {
enable: function() {
this.assign(1);
},
disable: function() {
this.assign(0);
},
assign: function(b) {
if (b == this.status)
return;
this.status = b;
this.element[b ? "addEventListener" : "removeEventListener"](this.type, this.handler, this.capture);
}
}