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 = {
add: function(el, events) {
for (var type in events) {
var func = events[type];
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);
});
}
}
for (var type in events)
el.addEventListener(type, events[type], false);
},
remove: function(el, events) {
for (var type in events) {
var func = events[type];
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);
}
}
for (var type in events)
el.removeEventListener(type, events[type], false);
},
getPoint: function(event) {