From 788897fcf278a7b46a57cc314523edafdc123cd9 Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 11 Feb 2022 13:09:53 +0100 Subject: [PATCH] removed dependencies by moving click handlers part of #2462 --- frontend/src/js/elements/commandline.js | 14 ++++++++++++++ frontend/src/js/ui.js | 19 ------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/frontend/src/js/elements/commandline.js b/frontend/src/js/elements/commandline.js index 9b4efeeea..f16cd4f51 100644 --- a/frontend/src/js/elements/commandline.js +++ b/frontend/src/js/elements/commandline.js @@ -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(); +}); diff --git a/frontend/src/js/ui.js b/frontend/src/js/ui.js index 411fe4050..837a5538e 100644 --- a/frontend/src/js/ui.js +++ b/frontend/src/js/ui.js @@ -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 (