Skip to content

Commit

Permalink
Fixed sidebar search
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Nov 10, 2021
1 parent 70ffed6 commit dfdfc23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ header svg {
display: block;
}

.sidebar li.hide {
.sidebar a.hide {
display: none;
}

Expand Down
10 changes: 4 additions & 6 deletions assets/js/script.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
(function() {
const nav = document.querySelectorAll('main nav');
const nav = document.querySelector('main nav');
const methods = document.querySelector('.sidebar .methods');

if(nav && methods) {
nav.forEach(function(el) {
methods.appendChild(el.cloneNode(true));
});
methods.appendChild(nav.cloneNode(true));
}

const open = document.querySelector('.open');
Expand Down Expand Up @@ -43,9 +41,9 @@

methods.querySelectorAll('a').forEach(function(item) {
if(regex.test(item.textContent)) {
item.parentNode.classList.remove('hide');
item.classList.remove('hide');
} else {
item.parentNode.classList.add('hide');
item.classList.add('hide');
}
});
});
Expand Down

0 comments on commit dfdfc23

Please sign in to comment.