mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
Cleanup + fixed a typo
A typo (TagsCollection vs. TagCollection) made levels crash when loading. There where still lot of stuff left for handling master branch in the visTag code, because visTag is a modified version of the visBranch-object. Therefore, clean up asome unused code Signed-off-by: Max Sikström <msikstrom@op5.com>
This commit is contained in:
parent
74342e2028
commit
7a06cfd0c7
7 changed files with 12 additions and 75 deletions
|
@ -90,7 +90,7 @@ GitVisuals.prototype.resetAll = function() {
|
|||
|
||||
this.visEdgeCollection.reset();
|
||||
this.visBranchCollection.reset();
|
||||
this.visTagsCollection.reset();
|
||||
this.visTagCollection.reset();
|
||||
|
||||
this.visNodeMap = {};
|
||||
this.rootCommit = null;
|
||||
|
|
|
@ -82,22 +82,11 @@ var VisTag = VisBase.extend({
|
|||
* compared in the goal (used in a goal visualization context
|
||||
*/
|
||||
getIsLevelTagCompared: function() {
|
||||
if (this.getIsMaster()) {
|
||||
return true; // master always compared
|
||||
}
|
||||
// we are not master, so return true if its not just master being compared
|
||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||
},
|
||||
|
||||
getIsMaster: function() {
|
||||
return this.get('tag').get('id') == 'master';
|
||||
},
|
||||
|
||||
getArrowTransform: function() {
|
||||
return 't2,20R-35';
|
||||
},
|
||||
|
||||
getTagStackIndex: function() {
|
||||
if (this.get('isHead')) {
|
||||
// head is never stacked with other Tages
|
||||
|
@ -133,10 +122,6 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getCommitID: function() {
|
||||
var target = this.get('tag').get('target');
|
||||
if (target.get('type') === 'tag') {
|
||||
// for HEAD
|
||||
target = target.get('target');
|
||||
}
|
||||
return target.get('id');
|
||||
},
|
||||
|
||||
|
@ -232,16 +217,10 @@ var VisTag = VisBase.extend({
|
|||
|
||||
getName: function() {
|
||||
var name = this.get('tag').getName();
|
||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
||||
var isRemote = this.getIsRemote();
|
||||
var isHg = this.gitEngine.getIsHg();
|
||||
|
||||
if (name === 'HEAD' && isHg) {
|
||||
name = '.';
|
||||
}
|
||||
|
||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
||||
return name + after;
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
nonTextToFront: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue