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