mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Remove legacy browser code since we're not supporting IE8 and below.
This commit is contained in:
parent
550749d057
commit
6d5e4329c1
1 changed files with 4 additions and 21 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue