mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 05:29:37 +08:00
Remove unused code
This commit is contained in:
parent
7ae4b4ad76
commit
781931721f
@ -1,41 +0,0 @@
|
||||
import { Dom } from 'rc-util';
|
||||
|
||||
export let transitionEndEvent = whichTransitionEvent();
|
||||
export let animationEndEvent = whichAnimationEvent();
|
||||
|
||||
function whichTransitionEvent() {
|
||||
const transitions = {
|
||||
'transition': 'transitionend',
|
||||
'OTransition': 'oTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'WebkitTransition': 'webkitTransitionEnd'
|
||||
};
|
||||
for (let t in transitions) {
|
||||
if (t in document.documentElement.style) {
|
||||
return transitions[t];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function whichAnimationEvent() {
|
||||
const animation = {
|
||||
'animation': 'animationend',
|
||||
'OAnimation': 'oAnimationEnd',
|
||||
'MozAnimation': 'animationend',
|
||||
'WebkitAnimation': 'webkitAnimationEnd'
|
||||
};
|
||||
for (let t in animation) {
|
||||
if (t in document.documentElement.style) {
|
||||
return animation[t];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export let addEventListenerOnce = function(element, type, handler) {
|
||||
var eventListener = Dom.addEventListener(element, type, function(event) {
|
||||
eventListener && eventListener.remove();
|
||||
handler(event);
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user