From ea1a2b3ba99553aebde204b175fe31f7c0bb3d0b Mon Sep 17 00:00:00 2001 From: LastSymphony12 Date: Tue, 12 Nov 2024 18:28:42 -0500 Subject: [PATCH] Update topic.js --- public/src/client/topic.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 12c36eaa74..a96cc69699 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -76,20 +76,19 @@ define('forum/topic', [ hooks.fire('action:topic.loaded', ajaxify.data); }; - function configurePostToggle() { - $(".topic").on("click", ".view-translated-btn", function () { - // Toggle the visibility of the next .translated-content div - $(this).closest('.sensitive-content-message').next('.translated-content').toggle(); - // Optionally, change the button text based on visibility - var isVisible = $(this).closest('.sensitive-content-message').next('.translated-content').is(':visible'); - if (isVisible) { - $(this).text('Hide the translated message.'); - } else { - $(this).text('Click here to view the translated message.'); - } - }); - } + $('.topic').on('click', '.view-translated-btn', function () { + // Toggle the visibility of the next .translated-content div + $(this).closest('.sensitive-content-message').next('.translated-content').toggle(); + // Optionally, change the button text based on visibility + var isVisible = $(this).closest('.sensitive-content-message').next('.translated-content').is(':visible'); + if (isVisible) { + $(this).text('Hide the translated message.'); + } else { + $(this).text('Click here to view the translated message.'); + } + }); + } function handleTopicSearch() { require(['mousetrap'], (mousetrap) => {