diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index b78ea3e3ac..71a895d887 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -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); }, diff --git a/chrome/skin/default/zotero/preferences.css b/chrome/skin/default/zotero/preferences.css index 4955eed3f9..f18efdc97a 100644 --- a/chrome/skin/default/zotero/preferences.css +++ b/chrome/skin/default/zotero/preferences.css @@ -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); }