From 0f2af2cb74c0a057a1c1287d5551485bd524c1dc Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 8 Mar 2012 00:11:54 -0300 Subject: [PATCH] Fix Firefox bugs ... --- mindplot/src/main/javascript/Topic.js | 2 +- web2d/src/main/javascript/peer/svg/TextPeer.js | 15 +++++++++++++-- wise-editor/src/main/webapp/js/editor.js | 10 +++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 78829339..a1c37fea 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -1173,7 +1173,7 @@ mindplot.Topic = new Class({ var relationships = child.getRelationships(); result = result.concat(relationships); - var innerChilds = core.Utils.flattenTopicChildElements(child); + var innerChilds = this._flatten2DElements(child); result = result.concat(innerChilds); } return result; diff --git a/web2d/src/main/javascript/peer/svg/TextPeer.js b/web2d/src/main/javascript/peer/svg/TextPeer.js index c67e2d1b..30071e50 100644 --- a/web2d/src/main/javascript/peer/svg/TextPeer.js +++ b/web2d/src/main/javascript/peer/svg/TextPeer.js @@ -155,14 +155,25 @@ web2d.peer.svg.TextPeer = new Class({ }, getWidth : function () { - var computedWidth = this._native.getBBox().width; + // Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround + try { + var computedWidth = this._native.getBBox().width; + } catch(e) { + computedWidth = 10; + } + var width = parseInt(computedWidth); width = width + this._font.getWidthMargin(); return width; }, getHeight : function () { - var computedHeight = this._native.getBBox().height; + // Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround + try { + var computedHeight = this._native.getBBox().height; + } catch(e) { + computedHeight = 10; + } return parseInt(computedHeight); }, diff --git a/wise-editor/src/main/webapp/js/editor.js b/wise-editor/src/main/webapp/js/editor.js index 93af025a..408f917f 100644 --- a/wise-editor/src/main/webapp/js/editor.js +++ b/wise-editor/src/main/webapp/js/editor.js @@ -38,11 +38,11 @@ function buildDesigner(options) { console.log(e); }); -// window.onerror = function() -// { -// errorDialog.show(); -// }; -// + window.onerror = function() + { + errorDialog.show(); + }; + // Configure default persistence manager ... var persistence; if (options.persistenceManager) {