mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 15:38:33 +02:00
makes other vis and refreshes it out
This commit is contained in:
parent
29d401e701
commit
5e151238c9
3 changed files with 81 additions and 18 deletions
|
@ -84,7 +84,7 @@ GitEngine.prototype.hasOrigin = function() {
|
|||
};
|
||||
|
||||
GitEngine.prototype.isOrigin = function() {
|
||||
return !!this.localRepro;
|
||||
return !!this.localRepo;
|
||||
};
|
||||
|
||||
GitEngine.prototype.exportTree = function() {
|
||||
|
@ -209,13 +209,24 @@ GitEngine.prototype.makeOrigin = function(tree) {
|
|||
// we grab the gitengine out of that and assign that as our origin repo
|
||||
// which connects the two
|
||||
var masterVis = this.gitVisuals.getVisualization();
|
||||
var originRepo = masterVis.makeOrigin({
|
||||
var originVis = masterVis.makeOrigin({
|
||||
localRepo: this,
|
||||
tree: this.getDefaultTree()
|
||||
});
|
||||
|
||||
this.origin = originRepo;
|
||||
originRepo.assignLocalRepo(this);
|
||||
// defer the starting of our animation until origin has been created
|
||||
this.animationQueue.set('defer', true);
|
||||
originVis.customEvents.on('gitEngineReady', function() {
|
||||
this.origin = originVis.gitEngine;
|
||||
originVis.gitEngine.assignLocalRepo(this);
|
||||
// and then here is the crazy part -- we need the ORIGIN to refresh
|
||||
// itself in a separate animation. @_____@
|
||||
this.origin.externalRefresh();
|
||||
this.animationQueue.start();
|
||||
}, this);
|
||||
|
||||
// add a simple refresh animation
|
||||
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
|
||||
};
|
||||
|
||||
GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) {
|
||||
|
@ -1462,6 +1473,16 @@ GitEngine.prototype.filterError = function(err) {
|
|||
}
|
||||
};
|
||||
|
||||
// called on a origin repo from a local -- simply refresh immediately with
|
||||
// an animation
|
||||
GitEngine.prototype.externalRefresh = function() {
|
||||
this.animationQueue = new AnimationQueue({
|
||||
callback: function() {}
|
||||
});
|
||||
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
|
||||
this.animationQueue.start();
|
||||
};
|
||||
|
||||
GitEngine.prototype.dispatch = function(command, deferred) {
|
||||
// current command, options, and args are stored in the gitEngine
|
||||
// for easy reference during processing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue