From bf8c5308f259f5c63f493bf5576977e70ae54ef0 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 15 May 2014 05:16:39 +0000 Subject: [PATCH] Fix exportImage behavior if multiple setCustomHandlers calls are made git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2843 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 8ed64f3b..f7323cd6 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -42,8 +42,8 @@ var saveAs; var svgCanvas, urldata, Utils = svgedit.utilities, isReady = false, + customExportImage = false, callbacks = [], - customHandlers = {}, /** * PREFS AND CONFIG */ @@ -420,9 +420,9 @@ var saveAs; svgCanvas.bind('saved', opts.save); } if (opts.exportImage) { - svgCanvas.bind('exported', checkCanvg(opts.exportImage)); + customExportImage = opts.exportImage; + svgCanvas.bind('exported', checkCanvg(customExportImage)); } - customHandlers = opts; }); }; @@ -3649,7 +3649,7 @@ var saveAs; return; } // Open placeholder window (prevents popup) - if (!customHandlers.exportImage) { + if (!customExportImage) { var str = uiStrings.notification.loadingImage; exportWindow = window.open( 'data:text/html;charset=utf-8,' + encodeURIComponent('' + str + '

' + str + '

'),