use rc-util addEventListener

This commit is contained in:
afc163 2015-08-18 16:21:56 +08:00
parent c0c9b4a8d5
commit 192f150bc2
2 changed files with 2 additions and 16 deletions

View File

@ -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')
};

View File

@ -1,6 +1,6 @@
import React from 'react';
import Dialog from 'rc-dialog';
import eventListener from './eventListener';
import { Dom } from 'rc-util';
function noop() {
}
@ -12,7 +12,7 @@ function onDocumentMousemove(e) {
};
}
eventListener.add(document, 'mousemove', onDocumentMousemove);
Dom.addEventListener(document, 'mousemove', onDocumentMousemove);
export default React.createClass({
getDefaultProps() {