[Pkg-javascript-commits] [d3-tip.js] 61/277: basic positioning

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

bhuvan-guest pushed a commit to branch master
in repository d3-tip.js.

commit cfa3482c9e82ae8e5f719b3e8c055308afa57fdd
Author: Justin Palmer <justin at github.com>
Date:   Fri Apr 5 14:51:00 2013 -0700

    basic positioning
---
 src/d3.tip.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/d3.tip.js b/src/d3.tip.js
index da0c328..a7a89c3 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -24,11 +24,13 @@ d3.svg.tip = function() {
   }
 
   tip.show = function(v) {
-    var bbox = get_screen_bbox()
-    console.log(bbox)
-    node.style.display = 'block'
-    var content = text.apply(this, arguments)
+    var bbox = get_screen_bbox(),
+        content = text.apply(this, arguments)
+
     node.innerText = content
+    node.style.display = 'block'
+    node.style.left = bbox.ne.x + 'px'
+    node.style.top  = bbox.ne.y + 'px'
   }
 
   tip.hide = function(v) {
@@ -90,6 +92,7 @@ d3.svg.tip = function() {
     var node = document.createElement('div')
     node.style.position = 'absolute'
     node.style.display = 'none'
+    node.style.boxSizing = 'border-box'
     return node
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git



More information about the Pkg-javascript-commits mailing list