Skip to content

Commit

Permalink
Update topic.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LastSymphony12 authored Nov 12, 2024
1 parent c3a3175 commit ea1a2b3
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions public/src/client/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit ea1a2b3

Please sign in to comment.