diff --git a/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp b/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp index 7c73d5df..82c899ea 100644 --- a/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp +++ b/wise-webapp/src/main/webapp/jsp/iframeWrapper.jsp @@ -16,14 +16,18 @@ $('submitBtn').addEvent('click', function () { var iframeWindow = $('dialogContentIframe').contentWindow; if (iframeWindow && (typeof iframeWindow.submitDialogForm == 'function')) { - var delay = iframeWindow.submitDialogForm(); - if (MooDialog.Request.active) { - if (!delay) { - MooDialog.Request.active.close(); - } else { - MooDialog.Request.active.close.delay(3000, MooDialog.Request.active); - } + var context = iframeWindow.submitDialogForm(true); + if (context) { + // This is a hack for the export function. If this is not done, the dialog is closed and the export fails. + var iframeForm = $('iframeExportForm'); + iframeForm.setAttribute('method', context.method); + iframeForm.setAttribute('action', context.action); + + $('svgXml').setAttribute('value', window.document.getElementById('workspaceContainer').innerHTML); + $('download').setAttribute('value', context.formatType); + iframeForm.submit(); } + MooDialog.Request.active.close(); } }); @@ -32,4 +36,9 @@ MooDialog.Request.active.close(); } }); - \ No newline at end of file + +
\ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp index 97de089b..e96d855d 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapExport.jsp @@ -58,18 +58,18 @@ // No way to obtain map svg. Hide panels.. if (window.location.pathname.indexOf('exportf') != -1) { $('#exportInfo').hide(); - $('#freemind,#pdf,#svg').click('click', function(event) { + $('#freemind,#pdf,#svg').click('click', function (event) { $('#imgFormat').hide(); }); - $('#img').click('click', function(event) { + $('#img').click('click', function (event) { $('#imgFormat').show(); }); } else { $('#pdf,#svg,#img').parent().hide(); } - function submitDialogForm() { + function submitDialogForm(differ) { // If the map is opened, use the latest model ... var formatType = $('#dialogMainForm input:checked').attr('value'); var form = $('#dialogMainForm'); @@ -88,17 +88,19 @@ form.attr('action', 'service/transform.' + formatType); // Load page SVG ... - var svg = window.parent.document.getElementById('workspaceContainer').innerHTML; - $('#svgXml').attr('value', svg); + var svgXml = window.parent.document.getElementById('workspaceContainer').innerHTML; + $('#svgXml').attr('value', svgXml); } $('#dialogMainForm input[name=download]').attr('value', formatType); - form.submit(); + if (!differ) { + form.submit(); + } // Close dialog ... $('#export-dialog-modal').modal('hide'); - return true; + return {"action":form.attr('action'), "method":form.attr('method'), formatType:formatType}; } \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 58c6596d..9ad5a6ac 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -6,7 +6,7 @@