From b914c9887f8b740c5fc070085cb6280e617d6803 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sat, 3 Nov 2012 15:00:35 -0700 Subject: [PATCH] trying to remove global references on gitEngine --- src/git.js | 8 ++------ src/visuals.js | 9 +++++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/git.js b/src/git.js index 513638f0..b90f9665 100644 --- a/src/git.js +++ b/src/git.js @@ -40,9 +40,6 @@ GitEngine.prototype.init = function() { // commit once to get things going this.commit(); - - // now we are ready - events.trigger('gitEngineReady', this); }; GitEngine.prototype.exportTree = function() { @@ -139,9 +136,8 @@ GitEngine.prototype.reloadGraphics = function() { this.gitVisuals.rootCommit = rootCommit; // this just basically makes the HEAD branch. the head branch really should have been - // a member of a collection and not this annoying edge case stuff... - // TODO -- hackyyy - this.gitVisuals.grabHeadBranch(); + // a member of a collection and not this annoying edge case stuff... one day TODO + this.gitVisuals.initHeadBranch(); // when the paper is ready this.gitVisuals.drawTreeFromReload(); diff --git a/src/visuals.js b/src/visuals.js index b4e1e063..7d4670b5 100644 --- a/src/visuals.js +++ b/src/visuals.js @@ -101,10 +101,15 @@ GitVisuals.prototype.resetAll = function() { GitVisuals.prototype.assignGitEngine = function(gitEngine) { this.gitEngine = gitEngine; - this.grabHeadBranch(); + this.initHeadBranch(); }; -GitVisuals.prototype.grabHeadBranch = function() { +GitVisuals.prototype.initHeadBranch = function() { + // it's unfortaunte we have to do this, but the head branch + // is an edge case because it's not part of a collection so + // we can't use events to load or unload it. thus we have to call + // this ugly method which will be deleted one day + // seed this with the HEAD pseudo-branch var headBranch = new VisBranch({ branch: this.gitEngine.HEAD,