mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-24 09:41:29 +00:00
fixes #40
This commit is contained in:
parent
c42f7aa6c1
commit
797ac73ff9
2 changed files with 2 additions and 15 deletions
static/js
|
@ -139,20 +139,7 @@ jQuery(document).ready(function() {
|
|||
$(".highlightable").unhighlight({ element: 'mark' }).highlight(value, { element: 'mark' });
|
||||
|
||||
if (ajax && ajax.abort) ajax.abort();
|
||||
ajax = jQuery.ajax({
|
||||
url: input.data('search-input') + ':' + value
|
||||
}).done(function(data) {
|
||||
if (data && data.results && data.results.length) {
|
||||
items.css('display', 'none');
|
||||
$('ul.topics').addClass('searched');
|
||||
data.results.forEach(function(navitem) {
|
||||
jQuery('[data-nav-id="' + navitem + '"]').css('display', 'block').addClass('search-match');
|
||||
jQuery('[data-nav-id="' + navitem + '"]').parents('li').css('display', 'block');
|
||||
});
|
||||
}
|
||||
;
|
||||
|
||||
});
|
||||
|
||||
jQuery('[data-search-clear]').on('click', function() {
|
||||
jQuery('[data-search-input]').val('').trigger('input');
|
||||
sessionStorage.removeItem('search-input');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue