Remove legacy browser code since we're not supporting IE8 and below.

This commit is contained in:
Jürg Lehni 2013-12-04 21:04:46 +01:00
parent 550749d057
commit 6d5e4329c1

View file

@ -17,30 +17,13 @@
*/ */
var DomEvent = { var DomEvent = {
add: function(el, events) { add: function(el, events) {
for (var type in events) { for (var type in events)
var func = events[type]; el.addEventListener(type, events[type], false);
if (el.addEventListener) {
el.addEventListener(type, func, false);
} else if (el.attachEvent) {
// Make a bound closure that calls on the right object and
// passes on the global event object as a parameter.
el.attachEvent('on' + type, func.bound = function() {
func.call(el, window.event);
});
}
}
}, },
remove: function(el, events) { remove: function(el, events) {
for (var type in events) { for (var type in events)
var func = events[type]; el.removeEventListener(type, events[type], false);
if (el.removeEventListener) {
el.removeEventListener(type, func, false);
} else if (el.detachEvent) {
// Remove the bound closure instead of func itself
el.detachEvent('on' + type, func.bound);
}
}
}, },
getPoint: function(event) { getPoint: function(event) {