From b69c35d548913e6d1a2957cb57e513ad58c72402 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 2 Jun 2013 17:43:56 -0700 Subject: [PATCH] know why its beause git engine ready is async and we dont have origin until that fires so animation gets messed up --- build/bundle.js | 26 +++++++++++++++++--- src/js/git/index.js | 3 +-- src/js/visuals/animation/animationFactory.js | 10 ++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/build/bundle.js b/build/bundle.js index 026c9913..3ef67e89 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -7327,8 +7327,7 @@ GitEngine.prototype.makeOrigin = function(treeString) { ); originMaster.set('remote', true); - // add a simple refresh animation - this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals); + this.animationFactory.playRefreshAnimationAndFinish(this.gitVisuals, this.animationQueue); }; GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) { @@ -9222,6 +9221,16 @@ AnimationFactory.prototype.playCommitBirthPromiseAnimation = function(commit, gi return animation.getPromise(); }; +AnimationFactory.prototype.playRefreshAnimationAndFinish = function(gitVisuals, animationQueue) { + var animation = new PromiseAnimation({ + closure: function() { + gitVisuals.refreshTree(); + } + }); + animation.play(); + animationQueue.thenFinish(animation.getPromise()); +}; + AnimationFactory.prototype.overrideOpacityDepth2 = function(attr, opacity) { opacity = (opacity === undefined) ? 1 : opacity; @@ -23250,8 +23259,7 @@ GitEngine.prototype.makeOrigin = function(treeString) { ); originMaster.set('remote', true); - // add a simple refresh animation - this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals); + this.animationFactory.playRefreshAnimationAndFinish(this.gitVisuals, this.animationQueue); }; GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) { @@ -31348,6 +31356,16 @@ AnimationFactory.prototype.playCommitBirthPromiseAnimation = function(commit, gi return animation.getPromise(); }; +AnimationFactory.prototype.playRefreshAnimationAndFinish = function(gitVisuals, animationQueue) { + var animation = new PromiseAnimation({ + closure: function() { + gitVisuals.refreshTree(); + } + }); + animation.play(); + animationQueue.thenFinish(animation.getPromise()); +}; + AnimationFactory.prototype.overrideOpacityDepth2 = function(attr, opacity) { opacity = (opacity === undefined) ? 1 : opacity; diff --git a/src/js/git/index.js b/src/js/git/index.js index fac83e56..2ffa5c3d 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -274,8 +274,7 @@ GitEngine.prototype.makeOrigin = function(treeString) { ); originMaster.set('remote', true); - // add a simple refresh animation - this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals); + this.animationFactory.playRefreshAnimationAndFinish(this.gitVisuals, this.animationQueue); }; GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) { diff --git a/src/js/visuals/animation/animationFactory.js b/src/js/visuals/animation/animationFactory.js index 4eb894d6..c1999e17 100644 --- a/src/js/visuals/animation/animationFactory.js +++ b/src/js/visuals/animation/animationFactory.js @@ -70,6 +70,16 @@ AnimationFactory.prototype.playCommitBirthPromiseAnimation = function(commit, gi return animation.getPromise(); }; +AnimationFactory.prototype.playRefreshAnimationAndFinish = function(gitVisuals, animationQueue) { + var animation = new PromiseAnimation({ + closure: function() { + gitVisuals.refreshTree(); + } + }); + animation.play(); + animationQueue.thenFinish(animation.getPromise()); +}; + AnimationFactory.prototype.overrideOpacityDepth2 = function(attr, opacity) { opacity = (opacity === undefined) ? 1 : opacity;