From aef78c6d99a1404ad3e8b464abdc3e2413a2146d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 19 Aug 2023 21:08:35 +0300 Subject: [PATCH] Fix group candidates search. Fix tag exclusion filter display --- public/index.html | 2 +- public/scripts/group-chats.js | 16 ++++------------ public/scripts/tags.js | 4 ++-- public/style.css | 7 ------- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/public/index.html b/public/index.html index 44c1dafd2..218c512a4 100644 --- a/public/index.html +++ b/public/index.html @@ -3274,7 +3274,7 @@
- +
diff --git a/public/scripts/group-chats.js b/public/scripts/group-chats.js index 2ce64a5fc..b5f51678b 100644 --- a/public/scripts/group-chats.js +++ b/public/scripts/group-chats.js @@ -63,8 +63,8 @@ import { getCropPopup, system_avatar, } from "../script.js"; -import { appendTagToList, createTagMapFromList, getTagsList, applyTagsOnCharacterSelect, tag_map } from './tags.js'; -import { FilterHelper } from './filters.js'; +import { appendTagToList, createTagMapFromList, getTagsList, applyTagsOnCharacterSelect, tag_map, printTagFilters } from './tags.js'; +import { FILTER_TYPES, FilterHelper } from './filters.js'; export { selected_group, @@ -1276,16 +1276,8 @@ function openCharacterDefinition(characterSelect) { } function filterGroupMembers() { - const searchValue = $(this).val().trim().toLowerCase(); - - if (!searchValue) { - $("#rm_group_add_members .group_member").removeClass('hiddenBySearch'); - } else { - $("#rm_group_add_members .group_member").each(function () { - const isValidSearch = $(this).find(".ch_name").text().toLowerCase().includes(searchValue); - $(this).toggleClass('hiddenBySearch', !isValidSearch); - }); - } + const searchValue = $(this).val().toLowerCase(); + groupCandidatesFilter.setFilterData(FILTER_TYPES.SEARCH, searchValue); } async function createGroup() { diff --git a/public/scripts/tags.js b/public/scripts/tags.js index cd8339358..a6887c7c6 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -285,8 +285,8 @@ function appendTagToList(listElement, tag, { removable, selectable, action, isGe tagElement.find('.tag_name').text('').attr('title', tag.name).addClass(tag.icon); } - if (tag.excluded) { - isGeneralList ? $(tagElement).addClass('excluded') : $(listElement).closest('.character_select, .group_select').addClass('hiddenByTag'); + if (tag.excluded && isGeneralList) { + $(tagElement).addClass('excluded'); } if (selectable) { diff --git a/public/style.css b/public/style.css index a7c66333d..a29a3cf8c 100644 --- a/public/style.css +++ b/public/style.css @@ -3977,13 +3977,6 @@ a { display: none; } -.hiddenByTag, -.hiddenByFav, -.hiddenByGroup, -.hiddenBySearch { - display: none !important; -} - /* Message images */ .mes .mes_img_container { max-width: 100%;