diff --git a/build/bundle.js b/build/bundle.js index 105f53a2..67019aa4 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -6739,8 +6739,8 @@ var Visualization = Backbone.View.extend({ treeString: JSON.stringify(options.tree) } )); - // return the newly created gitEngine - return this.originVis.gitEngine; + // return the newly created visualization which will soon have a git engine + return this.originVis; }, setTreeIndex: function(level) { @@ -7066,7 +7066,7 @@ GitEngine.prototype.hasOrigin = function() { }; GitEngine.prototype.isOrigin = function() { - return !!this.localRepro; + return !!this.localRepo; }; GitEngine.prototype.exportTree = function() { @@ -7191,13 +7191,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) { @@ -8444,6 +8455,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. @@ -22578,7 +22599,7 @@ GitEngine.prototype.hasOrigin = function() { }; GitEngine.prototype.isOrigin = function() { - return !!this.localRepro; + return !!this.localRepo; }; GitEngine.prototype.exportTree = function() { @@ -22703,13 +22724,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) { @@ -23956,6 +23988,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. @@ -33029,8 +33071,8 @@ var Visualization = Backbone.View.extend({ treeString: JSON.stringify(options.tree) } )); - // return the newly created gitEngine - return this.originVis.gitEngine; + // return the newly created visualization which will soon have a git engine + return this.originVis; }, setTreeIndex: function(level) { diff --git a/src/js/git/index.js b/src/js/git/index.js index b14d4cab..21f14ee2 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -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. diff --git a/src/js/visuals/visualization.js b/src/js/visuals/visualization.js index db8fda0a..aa758b9c 100644 --- a/src/js/visuals/visualization.js +++ b/src/js/visuals/visualization.js @@ -100,8 +100,8 @@ var Visualization = Backbone.View.extend({ treeString: JSON.stringify(options.tree) } )); - // return the newly created gitEngine - return this.originVis.gitEngine; + // return the newly created visualization which will soon have a git engine + return this.originVis; }, setTreeIndex: function(level) {