mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Replaced prompt() into a AskPopupView.password() Promise
This commit is contained in:
parent
1f0af5c0ac
commit
d9f50fa829
3 changed files with 38 additions and 8 deletions
|
|
@ -42,8 +42,8 @@ class AskPopupView extends AbstractViewPopup {
|
|||
* @param {boolean=} bFocusYesOnShow = true
|
||||
* @returns {void}
|
||||
*/
|
||||
onShow(askDesc, fYesFunc = null, fNoFunc = null, yesButton = '', noButton = '', isFocusYesOnShow = true) {
|
||||
this.askDesc(askDesc || '');
|
||||
onShow(sAskDesc, fYesFunc = null, fNoFunc = null, yesButton = '', noButton = '', isFocusYesOnShow = true) {
|
||||
this.askDesc(sAskDesc || '');
|
||||
this.yesButton(yesButton || i18n('POPUPS_ASK/BUTTON_YES'));
|
||||
this.noButton(noButton || i18n('POPUPS_ASK/BUTTON_NO'));
|
||||
this.fYesAction = fYesFunc;
|
||||
|
|
@ -75,4 +75,17 @@ class AskPopupView extends AbstractViewPopup {
|
|||
}
|
||||
}
|
||||
|
||||
AskPopupView.password = function(sAskDesc) {
|
||||
return new Promise(resolve => {
|
||||
this.showModal([
|
||||
sAskDesc + `<p>${i18n('GLOBAL/PASSWORD')}: <input type="password" autofocus=""></p>`,
|
||||
() => resolve(this.__dom.querySelector('input[type="password"]').value),
|
||||
() => resolve(null),
|
||||
'',
|
||||
i18n('GLOBAL/CANCEL'),
|
||||
false
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
export { AskPopupView, AskPopupView as default };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue