From 71c4abaab88bea38b2a8e9d9246190a163e2ae41 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 3 Feb 2016 18:45:20 +0000 Subject: [PATCH] Update dialog.js for progress dialog API change --- src/gui/html/js/dialog.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/html/js/dialog.js b/src/gui/html/js/dialog.js index e83f2243..f515db02 100644 --- a/src/gui/html/js/dialog.js +++ b/src/gui/html/js/dialog.js @@ -14,29 +14,34 @@ const progressDialog = document.getElementById('progressDialog'); progressDialog.getElementsByTagName('p')[0].textContent = text; if (!progressDialog.opened) { - progressDialog.showModal(); + progressDialog.open(); + } else { + progressDialog.center(); } } static closeProgress() { const progressDialog = document.getElementById('progressDialog'); if (progressDialog.opened) { + /* Center before closing so that when it is re-opened it does so in the + correct position. */ + progressDialog.center(); progressDialog.close(); } } static showMessage(title, text) { const dialog = document.createElement('loot-message-dialog'); + document.body.appendChild(dialog); dialog.setDismissable(false); dialog.showModal(title, text); - document.body.appendChild(dialog); } static askQuestion(title, text, confirmText, closeCallback) { const dialog = document.createElement('loot-message-dialog'); + document.body.appendChild(dialog); dialog.setConfirmText(confirmText); dialog.showModal(title, text, closeCallback); - document.body.appendChild(dialog); } static showNotification(text) {