subscribing to config event

part of #2462
This commit is contained in:
Miodec 2022-02-10 22:21:10 +01:00
parent bf93703ded
commit b43474b912
2 changed files with 6 additions and 2 deletions

View file

@ -3,7 +3,6 @@ import * as Sound from "./controllers/sound-controller";
import * as OutOfFocus from "./test/out-of-focus";
import * as Notifications from "./elements/notifications";
import * as LanguagePicker from "./settings/language-picker";
import * as UI from "./ui";
import * as CommandlineLists from "./elements/commandline-lists";
import * as BackgroundFilter from "./elements/custom-background-filter";
import LayoutList from "./test/layouts";
@ -361,7 +360,6 @@ export function setSwapEscAndTab(val, nosave) {
val = false;
}
config.swapEscAndTab = val;
UI.updateKeytips();
if (!nosave) saveToLocalStorage();
dispatchEvent("swapEscAndTab", config.swapEscAndTab);
}

View file

@ -270,3 +270,9 @@ $(document).on("click", "#top #menu .icon-button", (e) => {
}
return false;
});
$(document).ready(() => {
UpdateConfig.subscribeToEvent((eventKey) => {
if (eventKey === "swapEscAndTab") updateKeytips();
});
});