mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 15:38:33 +02:00
AWESSOMEEE now converted animation queue to promise based too
This commit is contained in:
parent
4619eb370c
commit
c8d117073f
4 changed files with 66 additions and 21 deletions
|
@ -842,12 +842,10 @@ GitEngine.prototype.fakeTeamwork = function(numToMake) {
|
|||
|
||||
var chainStep = _.bind(function() {
|
||||
var newCommit = makeOriginCommit();
|
||||
var animation = this.animationFactory.genCommitBirthPromiseAnimation(
|
||||
return this.animationFactory.playCommitBirthPromiseAnimation(
|
||||
newCommit,
|
||||
this.origin.gitVisuals
|
||||
);
|
||||
animation.play();
|
||||
return animation.getPromise();
|
||||
}, this);
|
||||
|
||||
var deferred = Q.defer();
|
||||
|
@ -862,6 +860,7 @@ GitEngine.prototype.fakeTeamwork = function(numToMake) {
|
|||
return chainStep();
|
||||
});
|
||||
}
|
||||
this.animationQueue.thenFinish(chain);
|
||||
|
||||
deferred.resolve();
|
||||
};
|
||||
|
@ -1764,13 +1763,16 @@ GitEngine.prototype.dispatch = function(command, deferred) {
|
|||
return;
|
||||
}
|
||||
|
||||
var willStartAuto = this.animationQueue.get('defer') ||
|
||||
this.animationQueue.get('promiseBased');
|
||||
|
||||
// only add the refresh if we didn't do manual animations
|
||||
if (!this.animationQueue.get('animations').length && !this.animationQueue.get('defer')) {
|
||||
if (!this.animationQueue.get('animations').length && !willStartAuto) {
|
||||
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
|
||||
}
|
||||
|
||||
// animation queue will call the callback when its done
|
||||
if (!this.animationQueue.get('defer')) {
|
||||
if (!willStartAuto) {
|
||||
this.animationQueue.start();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue