Preferences: Highlight parent of selected pane in navigation

Also, fix help and back buttons not hiding when starting a search.

Closes #3425
This commit is contained in:
Abe Jellinek 2023-09-21 13:38:17 -04:00
parent 9779c70915
commit f28873382d
2 changed files with 13 additions and 2 deletions

View file

@ -144,10 +144,21 @@ var Zotero_Preferences = {
child.hidden = true;
}
}
for (let navItem of this.navigation.children) {
navItem.setAttribute('data-parent-selected', pane.parent && navItem.value === pane.parent);
}
this.helpContainer.hidden = !pane.helpURL;
document.getElementById('prefs-subpane-back-button').hidden = !pane.parent;
}
else {
for (let navItem of this.navigation.children) {
navItem.setAttribute('data-parent-selected', false);
}
this.helpContainer.hidden = true;
document.getElementById('prefs-subpane-back-button').hidden = true;
}
Zotero.Prefs.set('lastSelectedPrefPane', paneID);
},

View file

@ -68,12 +68,12 @@
transition: background-color 0.2s ease;
}
#prefs-navigation > richlistitem[selected="true"] {
#prefs-navigation > richlistitem:is([selected="true"], [data-parent-selected="true"]) {
background-color: highlight;
color: highlighttext;
}
#prefs-navigation > richlistitem:not([selected="true"]):hover {
#prefs-navigation > richlistitem:not([selected="true"], [data-parent-selected="true"]):hover {
background-color: color-mix(in srgb, transparent 60%, highlight);
}