removed dependencies by moving click handlers

part of #2462
This commit is contained in:
Miodec 2022-02-11 13:09:53 +01:00
parent c0c0bccc7b
commit 788897fcf2
2 changed files with 14 additions and 19 deletions

View file

@ -634,3 +634,17 @@ $(document).on("click", "#testModesNotice .text-button", (event) => {
eval(func);
}
});
$(document).on("click", "#bottom .leftright .right .current-theme", (e) => {
if (e.shiftKey) {
UpdateConfig.setCustomTheme(!Config.customTheme);
} else {
CommandlineLists.pushCurrent(CommandlineLists.themeCommands);
show();
}
});
$(document.body).on("click", ".pageAbout .aboutEnableAds", () => {
CommandlineLists.pushCurrent(CommandlineLists.commandsEnableAds);
show();
});

View file

@ -3,8 +3,6 @@ import * as Notifications from "./elements/notifications";
import * as Caret from "./test/caret";
import * as TestLogic from "./test/test-logic";
import * as CustomText from "./test/custom-text";
import * as CommandlineLists from "./elements/commandline-lists";
import * as Commandline from "./elements/commandline";
import * as TestUI from "./test/test-ui";
import * as TestConfig from "./test/test-config";
import * as SignOutButton from "./account/sign-out-button";
@ -210,23 +208,6 @@ window.addEventListener("keydown", function (e) {
}
});
$(document).on("click", "#bottom .leftright .right .current-theme", (e) => {
if (e.shiftKey) {
UpdateConfig.setCustomTheme(!Config.customTheme);
} else {
// if (Config.customTheme) {
// toggleCustomTheme();
// }
CommandlineLists.pushCurrent(CommandlineLists.themeCommands);
Commandline.show();
}
});
$(document.body).on("click", ".pageAbout .aboutEnableAds", () => {
CommandlineLists.pushCurrent(CommandlineLists.commandsEnableAds);
Commandline.show();
});
window.addEventListener("beforeunload", (event) => {
// Cancel the event as stated by the standard.
if (