From 8b6e52e721a84ba04713a7f47507f7d0f2deefff Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 11 Feb 2022 16:17:13 +0100 Subject: [PATCH] removed dependency by moving click handler fixes 1 circular dependency part of #2462 --- frontend/src/js/popups/custom-text-popup.js | 4 ++++ frontend/src/js/test/test-config.js | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/js/popups/custom-text-popup.js b/frontend/src/js/popups/custom-text-popup.js index f7e721f80..337ad47fc 100644 --- a/frontend/src/js/popups/custom-text-popup.js +++ b/frontend/src/js/popups/custom-text-popup.js @@ -187,6 +187,10 @@ $("#customTextPopup .wordfilter").click(() => { WordFilterPopup.show(); }); +$(document).on("click", "#top .config .customText .text-button", () => { + show(); +}); + $(document).keydown((event) => { if ( event.key === "Escape" && diff --git a/frontend/src/js/test/test-config.js b/frontend/src/js/test/test-config.js index 8c4c12dc1..d362e371a 100644 --- a/frontend/src/js/test/test-config.js +++ b/frontend/src/js/test/test-config.js @@ -1,5 +1,4 @@ import UpdateConfig from "../config"; -import * as CustomTextPopup from "../popups/custom-text-popup"; import * as Misc from "./../misc"; // export function show() { @@ -157,10 +156,6 @@ export function update(previous, current) { ); } -$(document).on("click", "#top .config .customText .text-button", () => { - CustomTextPopup.show(); -}); - $(document).ready(() => { UpdateConfig.subscribeToEvent((eventKey, eventValue, eventValue2) => { if (eventKey === "mode") update(eventValue, eventValue2);