aboutsummaryrefslogtreecommitdiffstats
path: root/html
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2015-01-12 02:36:11 +0000
committerAdam Spiers <git@adamspiers.org>2015-01-12 02:36:11 +0000
commit563ddecafb9d0dfd783cabc35ceb28c3d8d60f59 (patch)
treedfe26b9c7b7bd3c0b36fecaaa469703e8beda172 /html
parent29fc2d2985403f9cd6730a9e5f775b01b8d89e09 (diff)
downloadgit-deps-563ddecafb9d0dfd783cabc35ceb28c3d8d60f59.tar.gz
tip only needs initializing once
Diffstat (limited to 'html')
-rw-r--r--html/js/git-deps-graph.coffee13
1 files changed, 7 insertions, 6 deletions
diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee
index adb78b7..202487d 100644
--- a/html/js/git-deps-graph.coffee
+++ b/html/js/git-deps-graph.coffee
@@ -204,8 +204,15 @@ draw_graph = (commitish) ->
# d.y = n.y;
# });
+ init_tip() unless tip?
draw_nodes fg, nodes
+init_tip = () ->
+ tip = d3.tip().attr("class", "d3-tip").html(tip_html)
+ fg.call tip
+ hide_tip_on_drag = d3cola.drag().on("dragstart", tip.hide)
+ nodes.call hide_tip_on_drag
+
# Required for object constancy: http://bost.ocks.org/mike/constancy/ ...
link_key = (link) ->
source = sha1_of_link_pointer(link.source)
@@ -289,12 +296,6 @@ explore_node = (d) ->
add_commitish d.sha1
draw_nodes = (fg, nodes) ->
- # Initialize tooltip
- tip = d3.tip().attr("class", "d3-tip").html(tip_html)
- fg.call tip
- hide_tip_on_drag = d3cola.drag().on("dragstart", tip.hide)
- nodes.call hide_tip_on_drag
-
rect = nodes.append("rect")
.attr("rx", 5)
.attr("ry", 5)