Trigger the svgEditorReady after the canvas is ready.

master
iuyiuy 2016-03-23 11:40:42 +01:00
parent a3dbb7c5af
commit 2fe15e4d3f
1 changed files with 15 additions and 15 deletions

View File

@ -535,21 +535,6 @@ TODOS
} }
}()); }());
// 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 setIcon = editor.setIcon = function(elem, icon_id, forcedSize) {
var icon = (typeof icon_id === 'string') ? $.getSvgIcon(icon_id, true) : icon_id.clone(); var icon = (typeof icon_id === 'string') ? $.getSvgIcon(icon_id, true) : icon_id.clone();
if (!icon) { if (!icon) {
@ -809,6 +794,21 @@ TODOS
origSource = '', origSource = '',
paintBox = {fill: null, stroke:null}; 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 // This sets up alternative dialog boxes. They mostly work the same way as
// their UI counterparts, expect instead of returning the result, a callback // their UI counterparts, expect instead of returning the result, a callback
// needs to be included that returns the result as its first parameter. // needs to be included that returns the result as its first parameter.