| 91 | /* css animation fix when animation applyied to .{action} instanceof .{action}-active */ |
| 92 | |
| 93 | animateElement(element, action, active, fn) { |
| 94 | element.classList.add(active); |
| 95 | |
| 96 | const styles = getComputedStyle(element); |
| 97 | const duration = parseFloat(styles['animationDuration']) || parseFloat(styles['transitionDuration']); |
| 98 | |
| 99 | element.classList.add(action); |
| 100 | |
| 101 | if (duration === 0) { |
| 102 | const styles = getComputedStyle(element); |
| 103 | const duration = parseFloat(styles['animationDuration']) || parseFloat(styles['transitionDuration']); |
| 104 | |
| 105 | clearTimeout(this.timeout); |
| 106 | |
| 107 | this.timeout = setTimeout(() => { |
| 108 | fn(); |
| 109 | }, duration * 1000) |
| 110 | } |
| 111 | |
| 112 | element.classList.remove(action, active); |
| 113 | } |
| 114 | |
| 115 | didEnter(e) { |
| 116 | const childDOM = ReactDOM.findDOMNode(this.el); |