mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +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
|
@ -16954,7 +16954,7 @@ GitVisuals.prototype.resetAll = function() {
|
||||||
|
|
||||||
this.visEdgeCollection.reset();
|
this.visEdgeCollection.reset();
|
||||||
this.visBranchCollection.reset();
|
this.visBranchCollection.reset();
|
||||||
this.visTagsCollection.reset();
|
this.visTagCollection.reset();
|
||||||
|
|
||||||
this.visNodeMap = {};
|
this.visNodeMap = {};
|
||||||
this.rootCommit = null;
|
this.rootCommit = null;
|
||||||
|
@ -19029,22 +19029,11 @@ var VisTag = VisBase.extend({
|
||||||
* compared in the goal (used in a goal visualization context
|
* compared in the goal (used in a goal visualization context
|
||||||
*/
|
*/
|
||||||
getIsLevelTagCompared: function() {
|
getIsLevelTagCompared: function() {
|
||||||
if (this.getIsMaster()) {
|
|
||||||
return true; // master always compared
|
|
||||||
}
|
|
||||||
// we are not master, so return true if its not just master being compared
|
// we are not master, so return true if its not just master being compared
|
||||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||||
},
|
},
|
||||||
|
|
||||||
getIsMaster: function() {
|
|
||||||
return this.get('tag').get('id') == 'master';
|
|
||||||
},
|
|
||||||
|
|
||||||
getArrowTransform: function() {
|
|
||||||
return 't2,20R-35';
|
|
||||||
},
|
|
||||||
|
|
||||||
getTagStackIndex: function() {
|
getTagStackIndex: function() {
|
||||||
if (this.get('isHead')) {
|
if (this.get('isHead')) {
|
||||||
// head is never stacked with other Tages
|
// head is never stacked with other Tages
|
||||||
|
@ -19080,10 +19069,6 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getCommitID: function() {
|
getCommitID: function() {
|
||||||
var target = this.get('tag').get('target');
|
var target = this.get('tag').get('target');
|
||||||
if (target.get('type') === 'tag') {
|
|
||||||
// for HEAD
|
|
||||||
target = target.get('target');
|
|
||||||
}
|
|
||||||
return target.get('id');
|
return target.get('id');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -19179,16 +19164,10 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
var name = this.get('tag').getName();
|
var name = this.get('tag').getName();
|
||||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
|
||||||
var isRemote = this.getIsRemote();
|
var isRemote = this.getIsRemote();
|
||||||
var isHg = this.gitEngine.getIsHg();
|
var isHg = this.gitEngine.getIsHg();
|
||||||
|
|
||||||
if (name === 'HEAD' && isHg) {
|
return name;
|
||||||
name = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
|
||||||
return name + after;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
nonTextToFront: function() {
|
nonTextToFront: function() {
|
||||||
|
@ -37343,7 +37322,7 @@ GitVisuals.prototype.resetAll = function() {
|
||||||
|
|
||||||
this.visEdgeCollection.reset();
|
this.visEdgeCollection.reset();
|
||||||
this.visBranchCollection.reset();
|
this.visBranchCollection.reset();
|
||||||
this.visTagsCollection.reset();
|
this.visTagCollection.reset();
|
||||||
|
|
||||||
this.visNodeMap = {};
|
this.visNodeMap = {};
|
||||||
this.rootCommit = null;
|
this.rootCommit = null;
|
||||||
|
@ -39660,22 +39639,11 @@ var VisTag = VisBase.extend({
|
||||||
* compared in the goal (used in a goal visualization context
|
* compared in the goal (used in a goal visualization context
|
||||||
*/
|
*/
|
||||||
getIsLevelTagCompared: function() {
|
getIsLevelTagCompared: function() {
|
||||||
if (this.getIsMaster()) {
|
|
||||||
return true; // master always compared
|
|
||||||
}
|
|
||||||
// we are not master, so return true if its not just master being compared
|
// we are not master, so return true if its not just master being compared
|
||||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||||
},
|
},
|
||||||
|
|
||||||
getIsMaster: function() {
|
|
||||||
return this.get('tag').get('id') == 'master';
|
|
||||||
},
|
|
||||||
|
|
||||||
getArrowTransform: function() {
|
|
||||||
return 't2,20R-35';
|
|
||||||
},
|
|
||||||
|
|
||||||
getTagStackIndex: function() {
|
getTagStackIndex: function() {
|
||||||
if (this.get('isHead')) {
|
if (this.get('isHead')) {
|
||||||
// head is never stacked with other Tages
|
// head is never stacked with other Tages
|
||||||
|
@ -39711,10 +39679,6 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getCommitID: function() {
|
getCommitID: function() {
|
||||||
var target = this.get('tag').get('target');
|
var target = this.get('tag').get('target');
|
||||||
if (target.get('type') === 'tag') {
|
|
||||||
// for HEAD
|
|
||||||
target = target.get('target');
|
|
||||||
}
|
|
||||||
return target.get('id');
|
return target.get('id');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -39810,16 +39774,10 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
var name = this.get('tag').getName();
|
var name = this.get('tag').getName();
|
||||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
|
||||||
var isRemote = this.getIsRemote();
|
var isRemote = this.getIsRemote();
|
||||||
var isHg = this.gitEngine.getIsHg();
|
var isHg = this.gitEngine.getIsHg();
|
||||||
|
|
||||||
if (name === 'HEAD' && isHg) {
|
return name;
|
||||||
name = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
|
||||||
return name + after;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
nonTextToFront: function() {
|
nonTextToFront: function() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.537ceec9.js
Normal file
1
build/bundle.min.537ceec9.js
Normal file
File diff suppressed because one or more lines are too long
2
build/bundle.min.js
vendored
2
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -445,7 +445,7 @@
|
||||||
For a much easier time perusing the source, see the individual files at:
|
For a much easier time perusing the source, see the individual files at:
|
||||||
https://github.com/pcottle/learnGitBranching
|
https://github.com/pcottle/learnGitBranching
|
||||||
-->
|
-->
|
||||||
<script src="build/bundle.min.2a1dff9e.js"></script>
|
<script src="build/bundle.min.537ceec9.js"></script>
|
||||||
|
|
||||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||||
The downside? No raw logs to parse for analytics, so I have to include
|
The downside? No raw logs to parse for analytics, so I have to include
|
||||||
|
|
|
@ -90,7 +90,7 @@ GitVisuals.prototype.resetAll = function() {
|
||||||
|
|
||||||
this.visEdgeCollection.reset();
|
this.visEdgeCollection.reset();
|
||||||
this.visBranchCollection.reset();
|
this.visBranchCollection.reset();
|
||||||
this.visTagsCollection.reset();
|
this.visTagCollection.reset();
|
||||||
|
|
||||||
this.visNodeMap = {};
|
this.visNodeMap = {};
|
||||||
this.rootCommit = null;
|
this.rootCommit = null;
|
||||||
|
|
|
@ -82,22 +82,11 @@ var VisTag = VisBase.extend({
|
||||||
* compared in the goal (used in a goal visualization context
|
* compared in the goal (used in a goal visualization context
|
||||||
*/
|
*/
|
||||||
getIsLevelTagCompared: function() {
|
getIsLevelTagCompared: function() {
|
||||||
if (this.getIsMaster()) {
|
|
||||||
return true; // master always compared
|
|
||||||
}
|
|
||||||
// we are not master, so return true if its not just master being compared
|
// we are not master, so return true if its not just master being compared
|
||||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||||
},
|
},
|
||||||
|
|
||||||
getIsMaster: function() {
|
|
||||||
return this.get('tag').get('id') == 'master';
|
|
||||||
},
|
|
||||||
|
|
||||||
getArrowTransform: function() {
|
|
||||||
return 't2,20R-35';
|
|
||||||
},
|
|
||||||
|
|
||||||
getTagStackIndex: function() {
|
getTagStackIndex: function() {
|
||||||
if (this.get('isHead')) {
|
if (this.get('isHead')) {
|
||||||
// head is never stacked with other Tages
|
// head is never stacked with other Tages
|
||||||
|
@ -133,10 +122,6 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getCommitID: function() {
|
getCommitID: function() {
|
||||||
var target = this.get('tag').get('target');
|
var target = this.get('tag').get('target');
|
||||||
if (target.get('type') === 'tag') {
|
|
||||||
// for HEAD
|
|
||||||
target = target.get('target');
|
|
||||||
}
|
|
||||||
return target.get('id');
|
return target.get('id');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -232,16 +217,10 @@ var VisTag = VisBase.extend({
|
||||||
|
|
||||||
getName: function() {
|
getName: function() {
|
||||||
var name = this.get('tag').getName();
|
var name = this.get('tag').getName();
|
||||||
var selected = this.get('tag') === this.gitEngine.HEAD.get('target');
|
|
||||||
var isRemote = this.getIsRemote();
|
var isRemote = this.getIsRemote();
|
||||||
var isHg = this.gitEngine.getIsHg();
|
var isHg = this.gitEngine.getIsHg();
|
||||||
|
|
||||||
if (name === 'HEAD' && isHg) {
|
return name;
|
||||||
name = '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
|
||||||
return name + after;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
nonTextToFront: function() {
|
nonTextToFront: function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue