From 7bb8cc63c6e42ed4f32e51b3e7d57c4f23c7df99 Mon Sep 17 00:00:00 2001 From: Kienz Date: Sun, 26 May 2013 01:19:54 +0200 Subject: [PATCH] Fix `fabric.util.getElementOffset` for Firefox --- src/util/dom_misc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/dom_misc.js b/src/util/dom_misc.js index 84a379ee..16224efe 100644 --- a/src/util/dom_misc.js +++ b/src/util/dom_misc.js @@ -142,7 +142,9 @@ * @return {String} Style attribute value of the given element. */ function getElementStyle(element, attr) { - element.style = element.style || { }; + if (!element.style) { + element.style = { }; + } if (fabric.document.defaultView && fabric.document.defaultView.getComputedStyle) { return fabric.document.defaultView.getComputedStyle(element, null)[attr];