optimize search
This commit is contained in:
parent
8d345d62cc
commit
d0da75869e
2 changed files with 11 additions and 3 deletions
|
@ -115,6 +115,11 @@ nav#entrylist {
|
|||
padding-left: 10px;
|
||||
}
|
||||
|
||||
nav li.abv-menu-re {
|
||||
filter: grayscale(100%);
|
||||
filter: gray;
|
||||
}
|
||||
|
||||
main {}
|
||||
|
||||
article.abv-entry {
|
||||
|
|
|
@ -91,11 +91,14 @@ $( document ).ready(function() {
|
|||
// Quick filter functionality
|
||||
$('#filter-entries').on("keyup", function () {
|
||||
var value = $(this).val().toLowerCase();
|
||||
if (value.length > 1) {
|
||||
$("#entrylist > ul > li").filter(function () {
|
||||
return $(this).toggle($(this).children('a').text().toLowerCase().indexOf(value) > -1)
|
||||
if (value.length > 0) {
|
||||
$("#entrylist > ul > li:not([hidden])").filter(function () {
|
||||
return $(this).toggle($(this).children('a').text().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").startsWith(value))
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#entrylist > ul > li").show();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue