From 6d5e4329c1f50b53ccedef1003777c658c6a1ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 4 Dec 2013 21:04:46 +0100 Subject: [PATCH] Remove legacy browser code since we're not supporting IE8 and below. --- src/dom/DomEvent.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/dom/DomEvent.js b/src/dom/DomEvent.js index 3d12611e..d01db9f8 100644 --- a/src/dom/DomEvent.js +++ b/src/dom/DomEvent.js @@ -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) {