mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -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 = {
|
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) {
|
||||||
|
|
Loading…
Reference in a new issue