Only trigger content search if search field length > 2

This commit is contained in:
Junior 2024-11-12 09:53:32 -05:00
parent 2e85705a20
commit 44420c8ad7

View File

@ -34,7 +34,7 @@ $(document).ready(function() {
}); });
$("#search").on("change keyup", function() { $("#search").on("change keyup", function() {
if ( searchTimeout ) clearTimeout(searchTimeout); if ( searchTimeout ) clearTimeout(searchTimeout);
searchTimeout = setTimeout(getContents, 500); if ( $("#search").val().length > 2 ) searchTimeout = setTimeout(getContents, 500);
}); });
}); });