[Pkg-javascript-commits] [d3-tip.js] 172/277: support css transitions

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:27 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 66489a8ebd527ccaa498a67af6b1cf017e6cba88
Author: Justin Palmer <justin at github.com>
Date:   Thu Sep 19 10:36:42 2013 -0700

    support css transitions
---
 src/d3.tip.js | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/d3.tip.js b/src/d3.tip.js
index 82ebc87..5ec2025 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -30,7 +30,9 @@ d3.tip = function() {
         nodel   = d3.select(node), i = 0,
         coords
 
-    nodel.html(content).style('display', 'block')
+    nodel.html(content)
+      .style({ opacity: 1, pointerEvents: 'all' })
+
     while(i--) nodel.classed(directions[i], false)
     coords = direction_callbacks.get(dir).apply(this)
     nodel.classed(dir, true).style({
@@ -45,8 +47,8 @@ d3.tip = function() {
   //
   // Returns a tip
   tip.hide = function() {
-    node.style.display = 'none'
-    node.innerHTML = ''
+    nodel = d3.select(node)
+    nodel.style({ opacity: 0, pointerEvents: 'none' })
 
     return tip
   }
@@ -202,11 +204,15 @@ d3.tip = function() {
   }
 
   function initNode() {
-    var node = document.createElement('div')
-    node.style.position = 'absolute'
-    node.style.display = 'none'
-    node.style.boxSizing = 'border-box'
-    return node
+    var node = d3.select(document.createElement('div'))
+    node.style({
+      position: 'absolute',
+      opacity: 0,
+      pointerEvents: 'none',
+      boxSizing: 'border-box'
+    })
+
+    return node.node()
   }
 
   function getSVGNode(el) {

-- 
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