diff options
| -rw-r--r-- | app/lib/tray-animator.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/lib/tray-animator.js b/app/lib/tray-animator.js index 03522fedbe..0245a6eca1 100644 --- a/app/lib/tray-animator.js +++ b/app/lib/tray-animator.js @@ -89,6 +89,18 @@ export class TrayAnimation { return this._nativeImages[this._currentFrame]; } + /** + * Prepare initial state for animation before running it. + * @memberOf TrayAnimation + */ + prepare() { + this._currentFrame = this._reverse ? this._numFrames - 1 : 0; + } + + /** + * Advance animation frame + * @memberOf TrayAnimation + */ advanceFrame() { // do not advance frame when animation is finished if(this._isFinished) { return; } @@ -117,8 +129,6 @@ export class TrayAnimation { } } - console.log('nextFrame: %d', nextFrame); - this._currentFrame = nextFrame; } @@ -139,7 +149,6 @@ export class TrayAnimation { /** * Tray icon animator - * * @class TrayAnimator */ export class TrayAnimator { @@ -177,6 +186,9 @@ export class TrayAnimator { this._timer = this._nextFrame(); this._started = true; + // prepare animation + this._animation.prepare(); + // update from initial frame this._updateTrayIcon(); } |
