This commit is contained in:
the-djmaze 2023-02-14 19:04:14 +01:00
parent bd9e50f222
commit 9dd917894d

View file

@ -59,6 +59,7 @@ export class AbstractViewPopup extends AbstractView
super('Popups' + name, ViewTypePopup); super('Popups' + name, ViewTypePopup);
this.keyScope.scope = name; this.keyScope.scope = name;
this.modalVisible = ko.observable(false).extend({ rateLimit: 0 }); this.modalVisible = ko.observable(false).extend({ rateLimit: 0 });
this.close = () => this.modalVisible(false);
addShortcut('escape,close', '', name, () => { addShortcut('escape,close', '', name, () => {
if (this.modalVisible() && false !== this.onClose()) { if (this.modalVisible() && false !== this.onClose()) {
this.close(); this.close();
@ -79,9 +80,6 @@ export class AbstractViewPopup extends AbstractView
onHide() {} // Happens before animation transitionend onHide() {} // Happens before animation transitionend
afterHide() {} // Happens after animation transitionend afterHide() {} // Happens after animation transitionend
*/ */
close() {
this.modalVisible(false);
}
} }
AbstractViewPopup.showModal = function(params = []) { AbstractViewPopup.showModal = function(params = []) {