Drop cancelCommand in favor of closeCommand and improve AbstractViewPopup handling

This commit is contained in:
the-djmaze 2022-02-24 22:40:17 +01:00
parent 06b5b83588
commit 2edd55f01f
36 changed files with 82 additions and 118 deletions

View file

@ -259,8 +259,6 @@ export class ComposePopupView extends AbstractViewPopup {
]
});
this.bDisabeCloseOnEsc = true;
this.tryToClosePopup = this.tryToClosePopup.debounce(200);
this.iTimer = 0;
@ -643,6 +641,11 @@ export class ComposePopupView extends AbstractViewPopup {
}
}
onClose() {
this.skipCommand();
return false;
}
skipCommand() {
this.bSkipNextHide = true;
@ -1330,10 +1333,6 @@ export class ComposePopupView extends AbstractViewPopup {
shortcuts.add('contextmenu', '', ScopeCompose, e => this.popupMenu(e));
shortcuts.add('m', 'meta', ScopeCompose, e => this.popupMenu(e));
shortcuts.add('escape,close', '', ScopeCompose, () => {
this.skipCommand();
return false;
});
shortcuts.add('arrowdown', 'meta', ScopeCompose, () => {
this.skipCommand();
return false;
@ -1360,7 +1359,7 @@ export class ComposePopupView extends AbstractViewPopup {
});
shortcuts.add('escape,close', 'shift', ScopeCompose, () => {
this.modalVisibility() && this.tryToClosePopup();
this.tryToClosePopup();
return false;
});