From afc9f54e5e4dca73c816ed0ae452a0ae0ff68b4a Mon Sep 17 00:00:00 2001 From: Azareal Date: Sun, 19 Jul 2020 17:22:49 +1000 Subject: [PATCH] bulk mod: unselect items by clicking them again. --- public/member.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/public/member.js b/public/member.js index 3ae72771..5aca6108 100644 --- a/public/member.js +++ b/public/member.js @@ -250,16 +250,29 @@ var imageExts = ["png","jpg","jpe","jpeg","jif","jfi","jfif","svg","bmp","gif"," $("#topicsItemList,#forumItemList").addClass("topics_moderate"); $(".topic_row").each(function(){ $(this).click(function(){ - if(!this.classList.contains("can_mod") || this.classList.contains("topic_selected")) return; - selectedTopics.push(parseInt($(this).attr("data-tid"),10)); + if(!this.classList.contains("can_mod")) return; + let tid = parseInt($(this).attr("data-tid"),10); + let sel = this.classList.contains("topic_selected"); + if(sel) { + for(var i=0; i