From 358b31389c1b29993d8a067ee3870f4797e63dba Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Wed, 27 Feb 2013 14:47:54 -0500 Subject: [PATCH] Fix tail flipping --- js/lib/d3.tail.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/lib/d3.tail.js b/js/lib/d3.tail.js index fce07b457..225892e30 100644 --- a/js/lib/d3.tail.js +++ b/js/lib/d3.tail.js @@ -31,11 +31,14 @@ d3.tail = function() { } + function show() { + container.style('display', 'block'); + tooltip_size = container.size(); + } + function mousemove() { if (text === false) return; - if (container.style('display') == 'none') { - container.style('display', 'block'); - } + if (container.style('display') === 'none') show(); var xoffset = ((d3.event.clientX + tooltip_size[0] + xmargin) > selection_size[0]) ? -tooltip_size[0] - xmargin : xmargin; container.classed('left', xoffset > 0); @@ -51,7 +54,7 @@ d3.tail = function() { function mouseover() { if (d3.event.relatedTarget !== container.node() && - text !== false) container.style('display', 'block'); + text !== false) show(); } if (!container) setup();