From 95b23b0760d3c52a17821fdc33fdb30a07cc10cc Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 27 Feb 2013 17:52:06 -0800 Subject: [PATCH] Add another div to the tail (#829) --- js/lib/d3.tail.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/lib/d3.tail.js b/js/lib/d3.tail.js index 225892e30..497bde4e1 100644 --- a/js/lib/d3.tail.js +++ b/js/lib/d3.tail.js @@ -1,6 +1,7 @@ d3.tail = function() { var text = false, container, + inner, xmargin = 25, tooltip_size = [0, 0], selection_size = [0, 0], @@ -13,11 +14,12 @@ d3.tail = function() { }); function setup() { - container = d3.select(document.body) .append('div') - .style('display', 'none') - .attr('class', 'tail tooltip-inner'); + .style('display', 'none') + .attr('class', 'tail tooltip-inner'); + + inner = container.append('div'); selection .on('mousemove.tail', mousemove) @@ -28,7 +30,6 @@ d3.tail = function() { .on('mousemove.tail', mousemove); selection_size = selection.size(); - } function show() { @@ -69,7 +70,7 @@ d3.tail = function() { return tail; } text = _; - container.text(text); + inner.text(text); tooltip_size = container.size(); return tail; };