check if .ch_fav exist b4 filtering

This commit is contained in:
Wilfred Chen
2023-04-22 01:32:43 +08:00
parent 8a1993ddf4
commit cb51cd0b68
2 changed files with 6 additions and 4 deletions

View File

@@ -3757,9 +3757,11 @@ $(document).ready(function () {
const selector = ['#rm_print_characters_block .character_select', '#rm_print_characters_block .group_select'].join(','); const selector = ['#rm_print_characters_block .character_select', '#rm_print_characters_block .group_select'].join(',');
if(filterByFav === true){ if(filterByFav === true){
$(selector).each(function () { $(selector).each(function () {
$(this).children(".ch_fav").val().toLowerCase().includes(1) if($(this).children(".ch_fav").length !== 0){
? $(this).show() $(this).children(".ch_fav").val().toLowerCase().includes(1)
: $(this).hide(); ? $(this).show()
: $(this).hide();
}
}); });
$("#filter_by_fav").css("color","#FFFF00"); $("#filter_by_fav").css("color","#FFFF00");
}else{ }else{

File diff suppressed because one or more lines are too long