mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 00:18:56 +02:00
BOOM reloadddding fixed
This commit is contained in:
parent
3281c88b52
commit
0a9ec17852
3 changed files with 22 additions and 11 deletions
18
src/git.js
18
src/git.js
|
@ -10,10 +10,9 @@ function GitEngine(options) {
|
|||
this.rootCommit = null;
|
||||
this.refs = {};
|
||||
this.HEAD = null;
|
||||
this.id_gen = 0;
|
||||
|
||||
this.branchCollection = options.branches;
|
||||
this.commitCollection = options.collection;
|
||||
|
||||
this.gitVisuals = options.gitVisuals;
|
||||
|
||||
// global variable to keep track of the options given
|
||||
|
@ -115,11 +114,20 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
|||
var branch = this.getOrMakeRecursive(tree, createdSoFar, branchJSON.id);
|
||||
|
||||
this.branchCollection.add(branch, {silent: true});
|
||||
this.gitVisuals.addBranch(branch, true /* paper override */);
|
||||
}, this);
|
||||
|
||||
var HEAD = this.getOrMakeRecursive(tree, createdSoFar, tree.HEAD.id);
|
||||
this.HEAD = HEAD;
|
||||
|
||||
this.rootCommit = createdSoFar['C0'];
|
||||
if (!this.rootCommit) {
|
||||
throw new Error('Need root commit of C0 for calculations');
|
||||
}
|
||||
this.refs = createdSoFar;
|
||||
|
||||
this.branchCollection.each(function(branch) {
|
||||
this.gitVisuals.addBranch(branch);
|
||||
}, this);
|
||||
};
|
||||
|
||||
GitEngine.prototype.reloadGraphics = function() {
|
||||
|
@ -213,6 +221,9 @@ GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) {
|
|||
GitEngine.prototype.removeAll = function() {
|
||||
this.branchCollection.reset();
|
||||
this.commitCollection.reset();
|
||||
this.refs = {};
|
||||
this.HEAD = null;
|
||||
this.rootCommit = null;
|
||||
|
||||
this.gitVisuals.resetAll();
|
||||
};
|
||||
|
@ -1602,6 +1613,7 @@ var Commit = Backbone.Model.extend({
|
|||
|
||||
_.each(this.get('parents'), function(parent) {
|
||||
parent.get('children').push(this);
|
||||
console.log('adding myself', this.get('id'), 'to parent', parent);
|
||||
this.addEdgeToVisuals(parent);
|
||||
}, this);
|
||||
}
|
||||
|
|
|
@ -524,6 +524,10 @@ GitVisuals.prototype.canvasResize = function(width, height) {
|
|||
}
|
||||
};
|
||||
|
||||
GitVisuals.prototype.addCommit = function(commit) {
|
||||
// TODO
|
||||
};
|
||||
|
||||
GitVisuals.prototype.addNode = function(id, commit) {
|
||||
this.commitMap[id] = commit;
|
||||
if (commit.get('rootCommit')) {
|
||||
|
@ -541,7 +545,6 @@ GitVisuals.prototype.addNode = function(id, commit) {
|
|||
if (this.gitReady) {
|
||||
visNode.genGraphics(this.paper);
|
||||
}
|
||||
|
||||
return visNode;
|
||||
};
|
||||
|
||||
|
|
10
todo.txt
10
todo.txt
|
@ -20,14 +20,10 @@ Minor Bugs to fix:
|
|||
|
||||
Big Bugs to fix:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
- load and save no longer work...
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Pre-publish things:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/*************************************
|
||||
** Publish Things **
|
||||
************************************/
|
||||
- cross browser support
|
||||
- minify JS
|
||||
- fix terminal input when extra long
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue