Skip to content

Commit

Permalink
Added tag support
Browse files Browse the repository at this point in the history
Internally, will be a git tag if name is surrounded with []
  • Loading branch information
JakeGinnivan authored and Jake Ginnivan committed Jun 17, 2014
1 parent bac66ba commit e51859a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions js/historyview.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,9 @@ define(['d3'], function () {
.append('g')
.attr('class', function (d) {
var classes = 'branch-tag';
if (d.name.indexOf('/') >= 0) {
if (d.name.indexOf('[') === 0 && d.name.indexOf(']') === d.name.length - 1) {
classes += ' git-tag';
} else if (d.name.indexOf('/') >= 0) {
classes += ' remote-branch';
} else if (d.name.toUpperCase() === 'HEAD') {
classes += ' head-tag';
Expand All @@ -684,7 +686,11 @@ define(['d3'], function () {
});

newTags.append('svg:text')
.text(function (d) { return d.name; })
.text(function (d) {
if (d.name.indexOf('[') === 0 && d.name.indexOf(']') === d.name.length - 1)
return d.name.substring(1, d.name.length - 1);
return d.name;
})
.attr('y', function (d) {
return tagY(d, view) + 14;
})
Expand Down Expand Up @@ -808,6 +814,10 @@ define(['d3'], function () {
return this;
},

tag: function (name) {
this.branch('[' + name + ']');
},

deleteBranch: function (name) {
var branchIndex,
commit;
Expand Down

0 comments on commit e51859a

Please sign in to comment.