[Pkg-javascript-commits] [d3-tip.js] 237/277: Fix screen bounding box detection in case the event target is foreignobject HTML content

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:34 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 6b5a2ce59c0a3abcce04dc56b12966948deaa086
Author: Romain Neutron <imprec at gmail.com>
Date:   Thu Jul 10 14:49:06 2014 +0200

    Fix screen bounding box detection in case the event target is foreignobject HTML content
---
 index.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 8c9f4e0..08cb221 100644
--- a/index.js
+++ b/index.js
@@ -256,8 +256,13 @@
     //
     // Returns an Object {n, s, e, w, nw, sw, ne, se}
     function getScreenBBox() {
-      var targetel   = target || d3.event.target,
-          bbox       = {},
+      var targetel   = target || d3.event.target;
+
+      while ('undefined' === typeof targetel.getScreenCTM && 'undefined' === targetel.parentNode) {
+          targetel = targetel.parentNode;
+      }
+
+      var bbox       = {},
           matrix     = targetel.getScreenCTM(),
           tbbox      = targetel.getBBox(),
           width      = tbbox.width,

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