mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
use rc-util addEventListener
This commit is contained in:
parent
c0c9b4a8d5
commit
192f150bc2
@ -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')
|
||||
};
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user