Highlight active sidebar button.
This commit is contained in:
@@ -35,6 +35,11 @@
|
|||||||
left: 75%;
|
left: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.model-manager .sidebar-buttons .sidebar-button-active {
|
||||||
|
border-color: var(--fg-color);
|
||||||
|
color: var(--fg-color);
|
||||||
|
}
|
||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
.model-manager h1 {
|
.model-manager h1 {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|||||||
@@ -3239,9 +3239,15 @@ class SidebarButtons {
|
|||||||
const modelManager = this.#modelManager.element;
|
const modelManager = this.#modelManager.element;
|
||||||
const sidebarButtons = this.element.children;
|
const sidebarButtons = this.element.children;
|
||||||
|
|
||||||
|
const buttonActiveState = "sidebar-button-active";
|
||||||
|
for (let i = 0; i < sidebarButtons.length; i++) {
|
||||||
|
sidebarButtons[i].classList.remove(buttonActiveState);
|
||||||
|
}
|
||||||
|
|
||||||
let buttonIndex;
|
let buttonIndex;
|
||||||
for (buttonIndex = 0; buttonIndex < sidebarButtons.length; buttonIndex++) {
|
for (buttonIndex = 0; buttonIndex < sidebarButtons.length; buttonIndex++) {
|
||||||
if (sidebarButtons[buttonIndex] === button) {
|
const sidebarButton = sidebarButtons[buttonIndex];
|
||||||
|
if (sidebarButton === button) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3259,6 +3265,8 @@ class SidebarButtons {
|
|||||||
if (stateIndex != buttonIndex) {
|
if (stateIndex != buttonIndex) {
|
||||||
const newSidebarState = sidebarStates[buttonIndex];
|
const newSidebarState = sidebarStates[buttonIndex];
|
||||||
modelManager.classList.add(newSidebarState);
|
modelManager.classList.add(newSidebarState);
|
||||||
|
const sidebarButton = sidebarButtons[buttonIndex];
|
||||||
|
sidebarButton.classList.add(buttonActiveState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user