mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-02 17:19:38 +02:00
Fix remaining quirks in "Filter lists" pane
Do not sticky unchecked lists in search mode. Propagate default status of a sublist upward to its parent entry.
This commit is contained in:
parent
d6eacd8cf6
commit
14637923fc
@ -371,16 +371,17 @@ const toggleFilterList = (elem, on, ui = false) => {
|
||||
const listEntry = elem.closest('.listEntry');
|
||||
if ( listEntry === null ) { return; }
|
||||
if ( listEntry.dataset.parent === 'root' ) { return; }
|
||||
const searchMode = dom.cl.has('#lists', 'searchMode');
|
||||
const input = qs$(listEntry, ':scope > .detailbar input');
|
||||
if ( on === undefined ) {
|
||||
on = input.checked === false;
|
||||
}
|
||||
input.checked = on;
|
||||
dom.cl.toggle(listEntry, 'checked', on);
|
||||
dom.cl.toggle(listEntry, 'stickied', ui && !on);
|
||||
dom.cl.toggle(listEntry, 'stickied', ui && !on && !searchMode);
|
||||
// Select/unselect descendants. Twist: if in search-mode, select only
|
||||
// search-matched descendants.
|
||||
const childListEntries = dom.cl.has('#lists', 'searchMode')
|
||||
const childListEntries = searchMode
|
||||
? qsa$(listEntry, '.listEntry.searchMatch')
|
||||
: qsa$(listEntry, '.listEntry');
|
||||
for ( const descendantList of childListEntries ) {
|
||||
@ -440,6 +441,9 @@ const updateListNode = listNode => {
|
||||
lastUpdateTemplateString.replace('{{ago}}', i18n.renderElapsedTimeToString(writeTime))
|
||||
);
|
||||
}
|
||||
if ( qs$(listNode, '.listEntry.isDefault') !== null ) {
|
||||
dom.cl.add(listNode, 'isDefault');
|
||||
}
|
||||
if ( qs$(listNode, '.listEntry.stickied') !== null ) {
|
||||
dom.cl.add(listNode, 'stickied');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user