1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-02 17:19:38 +02:00

In search-mode, select only search-matched descendants

Context: "Filter lists" pane.
This commit is contained in:
Raymond Hill 2023-05-17 09:21:14 -04:00
parent 0fa4cae4b2
commit d6eacd8cf6
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -378,8 +378,11 @@ const toggleFilterList = (elem, on, ui = false) => {
input.checked = on;
dom.cl.toggle(listEntry, 'checked', on);
dom.cl.toggle(listEntry, 'stickied', ui && !on);
// Select/unselect descendants
const childListEntries = qsa$(listEntry, '.listEntry');
// Select/unselect descendants. Twist: if in search-mode, select only
// search-matched descendants.
const childListEntries = dom.cl.has('#lists', 'searchMode')
? qsa$(listEntry, '.listEntry.searchMatch')
: qsa$(listEntry, '.listEntry');
for ( const descendantList of childListEntries ) {
dom.cl.toggle(descendantList, 'checked', on);
qs$(descendantList, ':scope > .detailbar input').checked = on;