()
| 244 | const alphaStep = toAlpha - fromAlpha; |
| 245 | |
| 246 | const performStep = () => { |
| 247 | const elapsed = (new Date()).getTime() - startTime; |
| 248 | if (elapsed >= duration) { |
| 249 | clearInterval(this.intervalId); |
| 250 | this.updateStyle(toAlpha); |
| 251 | if (onComplete) { |
| 252 | onComplete(); |
| 253 | } |
| 254 | } else { |
| 255 | const value = ((elapsed / duration) * alphaStep) + fromAlpha; |
| 256 | this.updateStyle(value); |
| 257 | } |
| 258 | }; |
| 259 | |
| 260 | this.updateStyle(this.opacity); |
| 261 | this.intervalId = setInterval(performStep, 50); |
nothing calls this directly
no test coverage detected