diff --git a/popup.js b/popup.js index defe523..cf96f25 100644 --- a/popup.js +++ b/popup.js @@ -301,32 +301,34 @@ function exportData() { filename: 'todo.json', saveAs: true }, function() { - if (location.href.indexOf('action=export') !== -1) { - window.close(); - } else { - document.querySelector('.satus-dialog__scrim').click(); - - satus.render({ - type: 'dialog', - - message: { - type: 'text', - label: 'dataExportedSuccessfully' - }, - section: { - type: 'section', - class: 'controls', + setTimeout(function() { + if (location.href.indexOf('action=export') !== -1) { + window.close(); + } else { + document.querySelector('.satus-dialog__scrim').click(); + + satus.render({ + type: 'dialog', - ok: { - type: 'button', - label: 'ok', - onclick: function() { - document.querySelector('.satus-dialog__scrim').click(); + message: { + type: 'text', + label: 'dataExportedSuccessfully' + }, + section: { + type: 'section', + class: 'controls', + + ok: { + type: 'button', + label: 'ok', + onclick: function() { + document.querySelector('.satus-dialog__scrim').click(); + } } } - } - }); - } + }); + } + }, 100); }); } diff --git a/src/js/functions.js b/src/js/functions.js index 44d33dc..70acf57 100644 --- a/src/js/functions.js +++ b/src/js/functions.js @@ -300,31 +300,33 @@ function exportData() { filename: 'todo.json', saveAs: true }, function() { - if (location.href.indexOf('action=export') !== -1) { - window.close(); - } else { - document.querySelector('.satus-dialog__scrim').click(); - - satus.render({ - type: 'dialog', - - message: { - type: 'text', - label: 'dataExportedSuccessfully' - }, - section: { - type: 'section', - class: 'controls', - - ok: { - type: 'button', - label: 'ok', - onclick: function() { - document.querySelector('.satus-dialog__scrim').click(); + setTimeout(function() { + if (location.href.indexOf('action=export') !== -1) { + window.close(); + } else { + document.querySelector('.satus-dialog__scrim').click(); + + satus.render({ + type: 'dialog', + + message: { + type: 'text', + label: 'dataExportedSuccessfully' + }, + section: { + type: 'section', + class: 'controls', + + ok: { + type: 'button', + label: 'ok', + onclick: function() { + document.querySelector('.satus-dialog__scrim').click(); + } } } - } - }); - } + }); + } + }, 100); }); }