On toggle when searching show unfiltered instead of hiding all
This commit is contained in:
@@ -72,7 +72,7 @@ $(function () {
|
||||
.replace(/-/g, '~');
|
||||
const $currentItem = $navList.find('.item[data-longname="' + longname + '"]:eq(0)');
|
||||
$currentItem.prependTo($navList);
|
||||
$currentItem.addClass('item-current');
|
||||
$currentItem.addClass('item-current toggle-manual-show');
|
||||
return {
|
||||
$nav: $nav,
|
||||
$navList: $navList,
|
||||
@@ -245,12 +245,18 @@ $(function () {
|
||||
// Toggle when click an item element
|
||||
search.$nav.on('click', '.toggle', function (e) {
|
||||
const clsItem = $(this).closest('.item');
|
||||
let shown;
|
||||
clsItem.find('.member-list').each(function (i, v) {
|
||||
shown = $(v).is(':visible');
|
||||
return !shown;
|
||||
let show;
|
||||
if (clsItem.hasClass('toggle-manual-show')) {
|
||||
show = false;
|
||||
} else if (clsItem.hasClass('toggle-manual-hide')) {
|
||||
show = true;
|
||||
} else {
|
||||
clsItem.find('.member-list li').each(function (i, v) {
|
||||
show = $(v).is(':hidden');
|
||||
return !show;
|
||||
});
|
||||
search.manualToggle(clsItem, !shown);
|
||||
}
|
||||
search.manualToggle(clsItem, !!show);
|
||||
});
|
||||
|
||||
// Auto resizing on navigation
|
||||
|
||||
@@ -202,10 +202,6 @@ li {
|
||||
.navigation.search-empty li.item .member-list {
|
||||
display: none;
|
||||
}
|
||||
/* but show the members of the current pages module / class */
|
||||
.navigation.search-empty li.item.item-current .member-list {
|
||||
display: block;
|
||||
}
|
||||
/* expand all members when one character is entered in the search field */
|
||||
.navigation.search-started li.item,
|
||||
.navigation.search-started .member-list,
|
||||
@@ -228,10 +224,8 @@ li {
|
||||
.navigation .item.toggle-manual-show li {
|
||||
display: block!important;
|
||||
}
|
||||
.navigation .item.toggle-manual-hide .member-list,
|
||||
.navigation .item.toggle-manual-hide li,
|
||||
.navigation.searching .item.toggle-manual-show .member-list:not(.match),
|
||||
.navigation.searching .item.toggle-manual-show li:not(.match) {
|
||||
.navigation:not(.searching) .item.toggle-manual-hide .member-list,
|
||||
.navigation:not(.searching) .item.toggle-manual-hide li {
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user