From 9c7a6e597327e44b55eba52feff77049f00cb145 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 7 Jul 2012 18:44:27 +0100 Subject: [PATCH] Firefox fix Was preventing zoomin animations working properly --- core/modules/treenodes/node.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/modules/treenodes/node.js b/core/modules/treenodes/node.js index f2a1c9de5..8cafa0c42 100644 --- a/core/modules/treenodes/node.js +++ b/core/modules/treenodes/node.js @@ -89,10 +89,19 @@ Node.prototype.getNodeBounds = function() { var t,bounds; if(this.domNode) { if(this.domNode.nodeType === 3) { // Node.TEXT_NODE - return this.domNode.parentNode.getBoundingClientRect(); + bounds = this.domNode.parentNode.getBoundingClientRect(); } else { - return this.domNode.getBoundingClientRect(); + bounds = this.domNode.getBoundingClientRect(); } + // Absurdly, Firefox requires us to do this, otherwise JSON.stringify() gets confused + return { + top: bounds.top, + left: bounds.left, + right: bounds.right, + bottom: bounds.bottom, + width: bounds.width, + height: bounds.height + }; } else { if(this.child) { return this.child.getNodeBounds();