Fix character list hiding on search / tag filtering

This commit is contained in:
SillyLossy
2023-05-21 22:51:40 +03:00
parent 50ef24b88f
commit 7420327279
2 changed files with 13 additions and 5 deletions

View File

@@ -4971,6 +4971,8 @@ $(document).ready(function () {
$(this).toggleClass('hiddenBySearch', !isValidSearch);
});
}
setCharListVisible();
});
$("#send_but").click(function () {
@@ -6211,7 +6213,7 @@ $(document).ready(function () {
//$children.each(function () { setCharListVisible($(this)) });
$("#rm_print_characters_block").on('scroll', debounce(function () {
const containerHeight = $children.length * $children.first().outerHeight();
const containerHeight = $children.length * $children.find(':visible').first().outerHeight();
$("#rm_print_characters_block").css('height', containerHeight);
//show and hide on scroll
setCharListVisible();

View File

@@ -1,4 +1,4 @@
import { characters, saveSettingsDebounced, this_chid, callPopup, menu_type } from "../script.js";
import { characters, saveSettingsDebounced, this_chid, callPopup, menu_type, setCharListVisible } from "../script.js";
import { selected_group } from "./group-chats.js";
export {
@@ -50,6 +50,8 @@ function applyFavFilter() {
}
}
});
setCharListVisible();
}
function filterByGroups() {
@@ -61,6 +63,8 @@ function filterByGroups() {
$(CHARACTER_SELECTOR).each((_, element) => {
$(element).toggleClass('hiddenByGroup', displayGroupsOnly && !$(element).hasClass('group_select'));
});
setCharListVisible();
}
function loadTagsSettings(settings) {
@@ -234,6 +238,8 @@ function onTagFilterClick(listElement) {
const tagIds = [...($(listElement).find(".tag.selected:not(.actionable)").map((_, el) => $(el).attr("id")))];
$(CHARACTER_SELECTOR).each((_, element) => applyFilterToElement(tagIds, element));
setCharListVisible();
}
function applyFilterToElement(tagIds, element) {