mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
refresh fromt ree bug and clicik bug
This commit is contained in:
parent
a83a12b211
commit
4db83ba808
6 changed files with 31 additions and 64 deletions
|
@ -7527,21 +7527,15 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
}
|
}
|
||||||
this.refs = createdSoFar;
|
this.refs = createdSoFar;
|
||||||
|
|
||||||
|
this.gitVisuals.gitReady = false;
|
||||||
this.branchCollection.each(function(branch) {
|
this.branchCollection.each(function(branch) {
|
||||||
this.gitVisuals.addBranch(branch);
|
this.gitVisuals.addBranch(branch);
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.reloadGraphics = function() {
|
GitEngine.prototype.reloadGraphics = function() {
|
||||||
// get the root commit, no better way to do it
|
// get the root commit
|
||||||
var rootCommit = null;
|
this.gitVisuals.rootCommit = this.refs['C0'];
|
||||||
this.commitCollection.each(function(commit) {
|
|
||||||
if (commit.get('id') == 'C0') {
|
|
||||||
rootCommit = commit;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.gitVisuals.rootCommit = rootCommit;
|
|
||||||
|
|
||||||
// this just basically makes the HEAD branch. the head branch really should have been
|
// 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... one day
|
// a member of a collection and not this annoying edge case stuff... one day
|
||||||
this.gitVisuals.initHeadBranch();
|
this.gitVisuals.initHeadBranch();
|
||||||
|
@ -15175,15 +15169,6 @@ GitVisuals.prototype.animateNodePositions = function(speed) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitVisuals.prototype.turnOnPaper = function() {
|
|
||||||
this.gitReady = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// does making an accessor method make it any less hacky? that is the true question
|
|
||||||
GitVisuals.prototype.turnOffPaper = function() {
|
|
||||||
this.gitReady = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
||||||
var action = _.bind(function() {
|
var action = _.bind(function() {
|
||||||
this.addBranch(branch);
|
this.addBranch(branch);
|
||||||
|
@ -15206,6 +15191,10 @@ GitVisuals.prototype.addBranch = function(branch) {
|
||||||
this.visBranchCollection.add(visBranch);
|
this.visBranchCollection.add(visBranch);
|
||||||
if (this.gitReady) {
|
if (this.gitReady) {
|
||||||
visBranch.genGraphics(this.paper);
|
visBranch.genGraphics(this.paper);
|
||||||
|
} else {
|
||||||
|
this.defer(_.bind(function() {
|
||||||
|
visBranch.genGraphics(this.paper);
|
||||||
|
}, this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15962,8 +15951,7 @@ var VisBranch = VisBase.extend({
|
||||||
this.gitVisuals = this.get('gitVisuals');
|
this.gitVisuals = this.get('gitVisuals');
|
||||||
this.gitEngine = this.get('gitEngine');
|
this.gitEngine = this.get('gitEngine');
|
||||||
if (!this.gitEngine) {
|
if (!this.gitEngine) {
|
||||||
console.log('throw damnit');
|
throw new Error('asd wtf');
|
||||||
throw new Error('asd');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('branch').set('visBranch', this);
|
this.get('branch').set('visBranch', this);
|
||||||
|
@ -16107,7 +16095,7 @@ var VisBranch = VisBase.extend({
|
||||||
|
|
||||||
getTextSize: function() {
|
getTextSize: function() {
|
||||||
var getTextWidth = function(visBranch) {
|
var getTextWidth = function(visBranch) {
|
||||||
var textNode = visBranch.get('text').node;
|
var textNode = (visBranch.get('text')) ? visBranch.get('text').node : null;
|
||||||
return (textNode === null) ? 0 : textNode.clientWidth;
|
return (textNode === null) ? 0 : textNode.clientWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17389,6 +17377,7 @@ var SeriesView = BaseView.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = $(ev.srcElement).attr('data-id');
|
var id = $(ev.srcElement).attr('data-id');
|
||||||
|
console.log(id, ev, ev.srcElement);
|
||||||
this.navEvents.trigger('clickedID', id);
|
this.navEvents.trigger('clickedID', id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -18692,21 +18681,15 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
}
|
}
|
||||||
this.refs = createdSoFar;
|
this.refs = createdSoFar;
|
||||||
|
|
||||||
|
this.gitVisuals.gitReady = false;
|
||||||
this.branchCollection.each(function(branch) {
|
this.branchCollection.each(function(branch) {
|
||||||
this.gitVisuals.addBranch(branch);
|
this.gitVisuals.addBranch(branch);
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.reloadGraphics = function() {
|
GitEngine.prototype.reloadGraphics = function() {
|
||||||
// get the root commit, no better way to do it
|
// get the root commit
|
||||||
var rootCommit = null;
|
this.gitVisuals.rootCommit = this.refs['C0'];
|
||||||
this.commitCollection.each(function(commit) {
|
|
||||||
if (commit.get('id') == 'C0') {
|
|
||||||
rootCommit = commit;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.gitVisuals.rootCommit = rootCommit;
|
|
||||||
|
|
||||||
// this just basically makes the HEAD branch. the head branch really should have been
|
// 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... one day
|
// a member of a collection and not this annoying edge case stuff... one day
|
||||||
this.gitVisuals.initHeadBranch();
|
this.gitVisuals.initHeadBranch();
|
||||||
|
@ -24639,6 +24622,7 @@ var SeriesView = BaseView.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = $(ev.srcElement).attr('data-id');
|
var id = $(ev.srcElement).attr('data-id');
|
||||||
|
console.log(id, ev, ev.srcElement);
|
||||||
this.navEvents.trigger('clickedID', id);
|
this.navEvents.trigger('clickedID', id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -25926,15 +25910,6 @@ GitVisuals.prototype.animateNodePositions = function(speed) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitVisuals.prototype.turnOnPaper = function() {
|
|
||||||
this.gitReady = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// does making an accessor method make it any less hacky? that is the true question
|
|
||||||
GitVisuals.prototype.turnOffPaper = function() {
|
|
||||||
this.gitReady = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
||||||
var action = _.bind(function() {
|
var action = _.bind(function() {
|
||||||
this.addBranch(branch);
|
this.addBranch(branch);
|
||||||
|
@ -25957,6 +25932,10 @@ GitVisuals.prototype.addBranch = function(branch) {
|
||||||
this.visBranchCollection.add(visBranch);
|
this.visBranchCollection.add(visBranch);
|
||||||
if (this.gitReady) {
|
if (this.gitReady) {
|
||||||
visBranch.genGraphics(this.paper);
|
visBranch.genGraphics(this.paper);
|
||||||
|
} else {
|
||||||
|
this.defer(_.bind(function() {
|
||||||
|
visBranch.genGraphics(this.paper);
|
||||||
|
}, this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26277,8 +26256,7 @@ var VisBranch = VisBase.extend({
|
||||||
this.gitVisuals = this.get('gitVisuals');
|
this.gitVisuals = this.get('gitVisuals');
|
||||||
this.gitEngine = this.get('gitEngine');
|
this.gitEngine = this.get('gitEngine');
|
||||||
if (!this.gitEngine) {
|
if (!this.gitEngine) {
|
||||||
console.log('throw damnit');
|
throw new Error('asd wtf');
|
||||||
throw new Error('asd');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('branch').set('visBranch', this);
|
this.get('branch').set('visBranch', this);
|
||||||
|
@ -26422,7 +26400,7 @@ var VisBranch = VisBase.extend({
|
||||||
|
|
||||||
getTextSize: function() {
|
getTextSize: function() {
|
||||||
var getTextWidth = function(visBranch) {
|
var getTextWidth = function(visBranch) {
|
||||||
var textNode = visBranch.get('text').node;
|
var textNode = (visBranch.get('text')) ? visBranch.get('text').node : null;
|
||||||
return (textNode === null) ? 0 : textNode.clientWidth;
|
return (textNode === null) ? 0 : textNode.clientWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@
|
||||||
<% for (var i = 0; i < ids.length; i++) { %>
|
<% for (var i = 0; i < ids.length; i++) { %>
|
||||||
<div class="levelIcon box center centerAlign vertical" id="levelIcon-<%=ids[i]%>" data-id="<%=ids[i]%>">
|
<div class="levelIcon box center centerAlign vertical" id="levelIcon-<%=ids[i]%>" data-id="<%=ids[i]%>">
|
||||||
<div class="index box" data-id="<%=ids[i]%>">
|
<div class="index box" data-id="<%=ids[i]%>">
|
||||||
<i class="icon-ok-circle"></i>
|
<i class="icon-ok-circle" data-id="<%=ids[i]%>"></i>
|
||||||
<div class="indexNum" data-id="<%=ids[i]%>">
|
<div class="indexNum" data-id="<%=ids[i]%>">
|
||||||
<%= i + 1 %>
|
<%= i + 1 %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -164,21 +164,15 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
|
||||||
}
|
}
|
||||||
this.refs = createdSoFar;
|
this.refs = createdSoFar;
|
||||||
|
|
||||||
|
this.gitVisuals.gitReady = false;
|
||||||
this.branchCollection.each(function(branch) {
|
this.branchCollection.each(function(branch) {
|
||||||
this.gitVisuals.addBranch(branch);
|
this.gitVisuals.addBranch(branch);
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.reloadGraphics = function() {
|
GitEngine.prototype.reloadGraphics = function() {
|
||||||
// get the root commit, no better way to do it
|
// get the root commit
|
||||||
var rootCommit = null;
|
this.gitVisuals.rootCommit = this.refs['C0'];
|
||||||
this.commitCollection.each(function(commit) {
|
|
||||||
if (commit.get('id') == 'C0') {
|
|
||||||
rootCommit = commit;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.gitVisuals.rootCommit = rootCommit;
|
|
||||||
|
|
||||||
// this just basically makes the HEAD branch. the head branch really should have been
|
// 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... one day
|
// a member of a collection and not this annoying edge case stuff... one day
|
||||||
this.gitVisuals.initHeadBranch();
|
this.gitVisuals.initHeadBranch();
|
||||||
|
|
|
@ -288,6 +288,7 @@ var SeriesView = BaseView.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = $(ev.srcElement).attr('data-id');
|
var id = $(ev.srcElement).attr('data-id');
|
||||||
|
console.log(id, ev, ev.srcElement);
|
||||||
this.navEvents.trigger('clickedID', id);
|
this.navEvents.trigger('clickedID', id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -557,15 +557,6 @@ GitVisuals.prototype.animateNodePositions = function(speed) {
|
||||||
}, this);
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitVisuals.prototype.turnOnPaper = function() {
|
|
||||||
this.gitReady = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// does making an accessor method make it any less hacky? that is the true question
|
|
||||||
GitVisuals.prototype.turnOffPaper = function() {
|
|
||||||
this.gitReady = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
GitVisuals.prototype.addBranchFromEvent = function(branch, collection, index) {
|
||||||
var action = _.bind(function() {
|
var action = _.bind(function() {
|
||||||
this.addBranch(branch);
|
this.addBranch(branch);
|
||||||
|
@ -588,6 +579,10 @@ GitVisuals.prototype.addBranch = function(branch) {
|
||||||
this.visBranchCollection.add(visBranch);
|
this.visBranchCollection.add(visBranch);
|
||||||
if (this.gitReady) {
|
if (this.gitReady) {
|
||||||
visBranch.genGraphics(this.paper);
|
visBranch.genGraphics(this.paper);
|
||||||
|
} else {
|
||||||
|
this.defer(_.bind(function() {
|
||||||
|
visBranch.genGraphics(this.paper);
|
||||||
|
}, this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,7 @@ var VisBranch = VisBase.extend({
|
||||||
this.gitVisuals = this.get('gitVisuals');
|
this.gitVisuals = this.get('gitVisuals');
|
||||||
this.gitEngine = this.get('gitEngine');
|
this.gitEngine = this.get('gitEngine');
|
||||||
if (!this.gitEngine) {
|
if (!this.gitEngine) {
|
||||||
console.log('throw damnit');
|
throw new Error('asd wtf');
|
||||||
throw new Error('asd');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('branch').set('visBranch', this);
|
this.get('branch').set('visBranch', this);
|
||||||
|
@ -200,7 +199,7 @@ var VisBranch = VisBase.extend({
|
||||||
|
|
||||||
getTextSize: function() {
|
getTextSize: function() {
|
||||||
var getTextWidth = function(visBranch) {
|
var getTextWidth = function(visBranch) {
|
||||||
var textNode = visBranch.get('text').node;
|
var textNode = (visBranch.get('text')) ? visBranch.get('text').node : null;
|
||||||
return (textNode === null) ? 0 : textNode.clientWidth;
|
return (textNode === null) ? 0 : textNode.clientWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue