afc163
9 years ago
2 changed files with 2 additions and 16 deletions
@ -1,14 +0,0 @@ |
|||
function wrap(standard, fallback) { |
|||
return function (el, evtName, listener, useCapture) { |
|||
if (el[standard]) { |
|||
el[standard](evtName, listener, useCapture); |
|||
} else if (el[fallback]) { |
|||
el[fallback]('on' + evtName, listener); |
|||
} |
|||
}; |
|||
} |
|||
|
|||
export default { |
|||
add: wrap('addEventListener', 'attachEvent'), |
|||
remove: wrap('removeEventListener', 'detachEvent') |
|||
}; |
Loading…
Reference in new issue