jscancer

Javascript crap (relatively small)
git clone git://git.codemadness.org/jscancer
Log | Files | Refs | README | LICENSE

commit a6b030dbb1c1443be3b756c189603688db70c330
parent a77d319fff5f1465898d949c51b940b0051cfcaa
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Thu,  2 Jun 2016 18:54:01 +0200

compat.js: add removeEventListener

Diffstat:
Mcompat.js | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compat.js b/compat.js @@ -16,7 +16,6 @@ if (typeof(Array) != "undefined" && typeof(Element) != "undefined" && l.push(fn(this[i])); return l; }; - // TODO: fix for IE8. if (!document.getElementsByClassName) Element.prototype.getElementsByClassName = document.getElementsByClassName = function(classname) { var els = this.getElementsByTagName("*"), l = [], @@ -39,6 +38,11 @@ if (typeof(Array) != "undefined" && typeof(Element) != "undefined" && return fn.apply(this, arguments); }); }; + if (!document.removeEventListener) + if (this.detachEvent) // IE DOM + Element.prototype.removeEventListener = document.removeEventListener = function(ev, fn, capture) { + this.detachEvent("on" + ev, fn); + }; if (!Event.prototype.stopPropagation) Event.prototype.stopPropagation = function() { window.event.cancelBubble = true;