Skip to content
This repository has been archived by the owner on Dec 13, 2017. It is now read-only.

Commit

Permalink
Fixes #9.
Browse files Browse the repository at this point in the history
  • Loading branch information
cha55son committed May 18, 2014
1 parent a01f525 commit 245f5dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/resources/js/commitgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
});
return deferred.promise();
};
CommitGraphVM.prototype.shortenName = function(name) {
if (name.length <= 25) return name;
return name.slice(0, 11) + '..' + name.slice(-11);
};
CommitGraphVM.prototype.buildGraph = function() {
/*
* node = [sha1, dotData, routeData, labelData]
Expand Down Expand Up @@ -147,11 +151,11 @@
var labels = [];
$.each(self.branches(), function(i, branch) {
if (branch.latestChangeset === commit.id)
labels.push(branch.displayId);
labels.push(self.shortenName(branch.displayId));
});
$.each(self.tags(), function(i, tag) {
if (tag.latestChangeset === commit.id)
labels.push(tag.displayId);
labels.push(self.shortenName(tag.displayId));
});
nodes.push([commit.id, [offset, branch], routes, labels]);
});
Expand Down

0 comments on commit 245f5dc

Please sign in to comment.