* Will stop exist animation firstly.
()
| 90 | * Will stop exist animation firstly. |
| 91 | */ |
| 92 | start(): AnimationWrap { |
| 93 | let count = this._storage.length; |
| 94 | |
| 95 | const checkTerminate = () => { |
| 96 | count--; |
| 97 | if (count <= 0) { // Guard. |
| 98 | this._storage.length = 0; |
| 99 | this._elExistsMap = {}; |
| 100 | this._finishedCallback && this._finishedCallback(); |
| 101 | } |
| 102 | }; |
| 103 | |
| 104 | for (let i = 0, len = this._storage.length; i < len; i++) { |
| 105 | const item = this._storage[i]; |
| 106 | item.el.animateTo(item.target, { |
| 107 | duration: item.duration, |
| 108 | delay: item.delay, |
| 109 | easing: item.easing, |
| 110 | setToFinal: true, |
| 111 | done: checkTerminate, |
| 112 | aborted: checkTerminate |
| 113 | }); |
| 114 | } |
| 115 | |
| 116 | return this; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | export function createWrap(): AnimationWrap { |
no outgoing calls
no test coverage detected