From 363f752934333cd3a6b7a83eea38ed9f0f1f4539 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 25 Mar 2017 22:50:37 +0300 Subject: [PATCH] Use messageBox in manage for confirm; partially revert c5741aff --- backup/fileSaveLoad.js | 11 ++-- manage.html | 12 ---- manage.js | 19 ++++++- msgbox/confirm.css | 80 --------------------------- msgbox/confirm.js | 50 ----------------- msgbox/msgbox.css | 70 +++++++++++++++-------- msgbox/msgbox.js | 123 +++++++++++++++++++++++++++-------------- popup.css | 72 ++++++++++++++++++++++++ popup.html | 2 - popup.js | 31 +++++++++-- 10 files changed, 250 insertions(+), 220 deletions(-) delete mode 100644 msgbox/confirm.css delete mode 100644 msgbox/confirm.js diff --git a/backup/fileSaveLoad.js b/backup/fileSaveLoad.js index f835bb47..faa5d204 100644 --- a/backup/fileSaveLoad.js +++ b/backup/fileSaveLoad.js @@ -130,13 +130,16 @@ function importFromString(jsonString) { `) .join(''); - const box = messageBox({ + messageBox({ title: 'Finished importing styles', contents: report || 'Nothing was changed.', buttons: [t('confirmOK'), numChanged && t('undo')], - onclick: btnIndex => btnIndex == 1 && undo(), - }); - bindClick(box); + onshow: bindClick, + }).then(({button, enter, esc}) => { + if (button == 1) { + undo(); + } + }); resolve(numChanged); }); } diff --git a/manage.html b/manage.html index 7e39d6d6..9f5fc519 100644 --- a/manage.html +++ b/manage.html @@ -5,7 +5,6 @@ -