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:
parent
9779c70915
commit
f28873382d
2 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue