mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 13:39:22 +03:00
Drop cancelCommand in favor of closeCommand and improve AbstractViewPopup handling
This commit is contained in:
parent
06b5b83588
commit
2edd55f01f
36 changed files with 82 additions and 118 deletions
|
|
@ -19,17 +19,16 @@ export class AskPopupView extends AbstractViewPopup {
|
|||
this.fNoAction = null;
|
||||
|
||||
this.focusOnShow = true;
|
||||
this.bDisabeCloseOnEsc = true;
|
||||
}
|
||||
|
||||
yesClick() {
|
||||
this.cancelCommand();
|
||||
this.closeCommand();
|
||||
|
||||
isFunction(this.fYesAction) && this.fYesAction();
|
||||
}
|
||||
|
||||
noClick() {
|
||||
this.cancelCommand();
|
||||
this.closeCommand();
|
||||
|
||||
isFunction(this.fNoAction) && this.fNoAction();
|
||||
}
|
||||
|
|
@ -52,10 +51,15 @@ export class AskPopupView extends AbstractViewPopup {
|
|||
this.focusOnShow = focusOnShow ? (askPass ? 'input[type="password"]' : '.buttonYes') : '';
|
||||
}
|
||||
|
||||
onShowWithDelay() {
|
||||
afterShow() {
|
||||
this.focusOnShow && this.querySelector(this.focusOnShow).focus();
|
||||
}
|
||||
|
||||
onClose() {
|
||||
this.noClick();
|
||||
return false;
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
// shortcuts.add('tab', 'shift', 'Ask', () => {
|
||||
shortcuts.add('tab,arrowright,arrowleft', '', 'Ask', () => {
|
||||
|
|
@ -66,11 +70,6 @@ export class AskPopupView extends AbstractViewPopup {
|
|||
btn.focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
shortcuts.add('escape', '', 'Ask', () => {
|
||||
this.noClick();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue