aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2015-01-08 16:35:27 +0000
committerAdam Spiers <git@adamspiers.org>2015-01-08 16:35:49 +0000
commit3aea00047dc8bae43b506b3ba0049d4005716710 (patch)
tree7cd76294ed4efc3ede5c734aa0713d39d5c96785
parente749e283f9c1691ef7603e785bdd14c393f8e2ea (diff)
downloadgit-deps-3aea00047dc8bae43b506b3ba0049d4005716710.tar.gz
show node index in tooltip in debug mode
-rw-r--r--html/js/git-deps-graph.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/html/js/git-deps-graph.js b/html/js/git-deps-graph.js
index a50840b..8e31548 100644
--- a/html/js/git-deps-graph.js
+++ b/html/js/git-deps-graph.js
@@ -219,8 +219,6 @@ function draw_nodes(fg, node) {
d.width = d.rect_width + 2 * MARGIN;
d.height = d.rect_height + 2 * MARGIN;
});
- // label.append("title")
- // .text(function (d) { return d.name; });
position_nodes(rect, label, tip);
}
@@ -270,7 +268,12 @@ function tip_html(d) {
fragment.find("time.commit-time")
.attr('datetime', date.toISOString())
.text(date);
- fragment.find(".commit-body pre").text(d.body);
+ var pre = fragment.find(".commit-body pre").text(d.body);
+
+ if (options.debug) {
+ pre.after("node index: " + node_index[d.sha]);
+ }
+
// Javascript *sucks*. There's no way to get the outerHTML of a
// document fragment, so you have to wrap the whole thing in a
// single parent and then look that up via children[0].