From 602b9d34e4e75bb969d287794286adfa77789418 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 25 Jul 2013 16:58:42 +0100 Subject: [PATCH] Unpack the object returned by getBoundingClientRect() Embedding the return object directly doesn't survive the object being passed as an event parameter. Fixes #114 --- core/modules/widgets/link.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js index 8e65bc4a7..a59d33895 100644 --- a/core/modules/widgets/link.js +++ b/core/modules/widgets/link.js @@ -95,10 +95,18 @@ LinkWidget.prototype.handleClickEvent = function(event) { event.target.setAttribute("target","_blank"); return true; } else { + var bounds = this.renderer.domNode.getBoundingClientRect(); $tw.utils.dispatchCustomEvent(event.target,"tw-navigate",{ navigateTo: this.to, navigateFromNode: this, - navigateFromClientRect: this.renderer.domNode.getBoundingClientRect() + navigateFromClientRect: { + top: bounds.top, + left: bounds.left, + width: bounds.width, + right: bounds.right, + bottom: bounds.bottom, + height: bounds.height + } }); event.preventDefault(); event.stopPropagation();