From 2fe15e4d3f333cade7b5e5ab60a6f593c1091a9c Mon Sep 17 00:00:00 2001 From: iuyiuy Date: Wed, 23 Mar 2016 11:40:42 +0100 Subject: [PATCH] Trigger the svgEditorReady after the canvas is ready. --- editor/svg-editor.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 25bbbb2c..fe791bb5 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -534,21 +534,6 @@ TODOS setupCurPrefs(); } }()); - - // For external openers - (function() { - // let the opener know SVG Edit is ready (now that config is set up) - var svgEditorReadyEvent, - w = window.opener; - if (w) { - try { - svgEditorReadyEvent = w.document.createEvent('Event'); - svgEditorReadyEvent.initEvent('svgEditorReady', true, true); - w.document.documentElement.dispatchEvent(svgEditorReadyEvent); - } - catch(e) {} - } - }()); var setIcon = editor.setIcon = function(elem, icon_id, forcedSize) { var icon = (typeof icon_id === 'string') ? $.getSvgIcon(icon_id, true) : icon_id.clone(); @@ -808,6 +793,21 @@ TODOS ui_context = 'toolbars', origSource = '', paintBox = {fill: null, stroke:null}; + + // For external openers + (function() { + // let the opener know SVG Edit is ready (now that config is set up) + var svgEditorReadyEvent, + w = window.opener; + if (w) { + try { + svgEditorReadyEvent = w.document.createEvent('Event'); + svgEditorReadyEvent.initEvent('svgEditorReady', true, true); + w.document.documentElement.dispatchEvent(svgEditorReadyEvent); + } + catch(e) {} + } + }()); // This sets up alternative dialog boxes. They mostly work the same way as // their UI counterparts, expect instead of returning the result, a callback