mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #112 from sanskar-mk2/bg-filter-feature
add bg filter feature on the frontend
This commit is contained in:
@ -1313,6 +1313,7 @@
|
||||
</div>
|
||||
<div class="drawer-content closedDrawer">
|
||||
<div class="flex-container">
|
||||
<input id="bg-filter" placeholder="Filter" class="text_pole" type="search" />
|
||||
<div id="bg_menu_content">
|
||||
<form id="form_bg_download" class="bg_example no-border no-shadow" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||
<label class="input-file">
|
||||
|
@ -5075,4 +5075,16 @@ $(document).ready(function () {
|
||||
closeMessageEditor();
|
||||
}
|
||||
});
|
||||
|
||||
$("#bg-filter").on("input", function() {
|
||||
const filterValue = $(this).val().toLowerCase();
|
||||
$("#bg_menu_content > div").each(function() {
|
||||
const $bgContent = $(this);
|
||||
if ($bgContent.attr("title").toLowerCase().includes(filterValue)) {
|
||||
$bgContent.show();
|
||||
} else {
|
||||
$bgContent.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
|
Reference in New Issue
Block a user