Rename Event listener
Remove hacks
This commit is contained in:
@@ -1075,7 +1075,7 @@ if (document.execCommand) try {
|
||||
} catch (e){}
|
||||
|
||||
/*<ltIE9>*/
|
||||
if (this.attachEvent && !this.addEventListener){
|
||||
if (this.attachEvent && !this.addEvent){
|
||||
var unloadEvent = function(){
|
||||
this.detachEvent('onunload', unloadEvent);
|
||||
document.head = document.html = document.window = null;
|
||||
@@ -3348,13 +3348,13 @@ if (!document.createElement('div').contains) Element.implement(contains);
|
||||
} else {
|
||||
collected[$uid(this)] = this;
|
||||
}
|
||||
if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]);
|
||||
if (this.addEvent) this.addEvent(type, fn, !!arguments[2]);
|
||||
else this.attachEvent('on' + type, fn);
|
||||
return this;
|
||||
},
|
||||
|
||||
removeListener: function(type, fn){
|
||||
if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]);
|
||||
if (this.removeEvent) this.removeEvent(type, fn, !!arguments[2]);
|
||||
else this.detachEvent('on' + type, fn);
|
||||
return this;
|
||||
},
|
||||
@@ -3380,7 +3380,7 @@ if (!document.createElement('div').contains) Element.implement(contains);
|
||||
});
|
||||
|
||||
/*<ltIE9>*/
|
||||
if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){
|
||||
if (window.attachEvent && !window.addEvent) window.addListener('unload', function(){
|
||||
Object.each(collected, clean);
|
||||
if (window.CollectGarbage) CollectGarbage();
|
||||
});
|
||||
|
Reference in New Issue
Block a user