23 lines
No EOL
577 B
JavaScript
Executable file
23 lines
No EOL
577 B
JavaScript
Executable file
'use strict';
|
|
var canUseDOM = require('../util/inDOM');
|
|
var on = function on() {};
|
|
|
|
if (canUseDOM) {
|
|
on = (function () {
|
|
|
|
if (document.addEventListener) return function (node, eventName, handler, capture) {
|
|
return node.addEventListener(eventName, handler, capture || false);
|
|
};else if (document.attachEvent) return function (node, eventName, handler) {
|
|
return node.attachEvent('on' + eventName, handler);
|
|
};
|
|
})();
|
|
}
|
|
|
|
module.exports = on;
|
|
|
|
|
|
//////////////////
|
|
// WEBPACK FOOTER
|
|
// ./~/dom-helpers/events/on.js
|
|
// module id = 2012
|
|
// module chunks = 4
|