mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
mark: fix opening of menus if search term was found #452
This commit is contained in:
parent
94e993b60e
commit
322a86ae47
1 changed files with 3 additions and 3 deletions
|
@ -797,7 +797,7 @@ function mark() {
|
|||
}
|
||||
if( parent.tagName.toLowerCase() === 'li' ){
|
||||
var toggleInputs = parent.querySelectorAll( 'input.toggle:not(.menu-marked)' );
|
||||
if( i.length ){
|
||||
if( toggleInputs.length ){
|
||||
toggleInputs[0].classList.add( 'menu-marked' );
|
||||
toggleInputs[0].dataset.checked = toggleInputs[0].checked ? 'true' : 'false';
|
||||
toggleInputs[0].checked = true;
|
||||
|
@ -874,11 +874,11 @@ function unmark() {
|
|||
while( parent && parent.classList ){
|
||||
if( parent.tagName.toLowerCase() === 'li' ){
|
||||
var toggleInputs = parent.querySelectorAll( 'input.toggle.menu-marked' );
|
||||
if( i.length ){
|
||||
if( toggleInputs.length ){
|
||||
toggleInputs[0].checked = toggleInputs[0].dataset.checked === 'true';
|
||||
toggleInputs[0].dataset.checked = null;
|
||||
toggleInputs[0].classList.remove( 'menu-marked' );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( parent.classList.contains( 'expand-marked' ) ){
|
||||
parent.classList.remove( 'expand-marked' );
|
||||
|
|
Loading…
Reference in a new issue