Cleanup AppUserStore

Simplify KeyState/Focused as Scope enum
This commit is contained in:
djmaze 2021-03-16 16:06:16 +01:00
parent 62cb918180
commit eff92c3152
27 changed files with 177 additions and 232 deletions

View file

@ -1,6 +1,6 @@
import ko from 'ko';
import { KeyState, Notification } from 'Common/Enums';
import { Scope, Notification } from 'Common/Enums';
import { getNotification, i18n } from 'Common/Translator';
import Remote from 'Remote/Admin/Fetch';
@ -27,7 +27,7 @@ class PluginPopupView extends AbstractViewPopup {
this.hasConfiguration = ko.computed(() => 0 < this.configures().length);
this.bDisabeCloseOnEsc = true;
this.sDefaultKeyScope = KeyState.All;
this.sDefaultScope = Scope.All;
this.tryToClosePopup = this.tryToClosePopup.debounce(200);
@ -101,7 +101,7 @@ class PluginPopupView extends AbstractViewPopup {
}
onBuild() {
shortcuts.add('escape', '', KeyState.All, () => {
shortcuts.add('escape', '', Scope.All, () => {
if (this.modalVisibility()) {
this.tryToClosePopup();
}