Merge pull request #112 from sanskar-mk2/bg-filter-feature

add bg filter feature on the frontend
This commit is contained in:
Cohee
2023-04-20 14:25:10 +03:00
committed by GitHub
2 changed files with 13 additions and 0 deletions

View File

@ -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">

View 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();
}
});
});
})