Highlight travel log tabs when selected
This commit is contained in:
parent
93178b8f09
commit
47cc43572f
2 changed files with 14 additions and 0 deletions
|
|
@ -38,12 +38,14 @@ export class ProgressStatusEvent extends RPEvent {
|
|||
travelLogDialog = new TravelLogDialog(dataItems);
|
||||
new FloatingWindow("Travel Log", travelLogDialog, dstate.x, dstate.y).setId("travellog");
|
||||
}
|
||||
travelLogDialog.updateTabs();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!travelLogDialog) {
|
||||
return;
|
||||
}
|
||||
travelLogDialog.updateTabs();
|
||||
|
||||
if (!this["item"]) {
|
||||
if (progressType === "repeatable") {
|
||||
|
|
|
|||
|
|
@ -67,12 +67,24 @@ export class TravelLogDialog extends DialogContentComponent {
|
|||
});
|
||||
}
|
||||
|
||||
public updateTabs() {
|
||||
document.querySelectorAll(".progressTypeButton").forEach((tab) => {
|
||||
const element = document.getElementById(tab.id)! as HTMLElement;
|
||||
if (element.id == this.currentProgressType) {
|
||||
// highlight selected tab
|
||||
element.style.setProperty("background-color", "#b3b3b3");
|
||||
} else {
|
||||
element.style.removeProperty("background-color");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private onProgressTypeButtonClick(event: Event) {
|
||||
// clear details when changing category
|
||||
this.refreshDetails();
|
||||
|
||||
this.currentProgressType = (event.target as HTMLElement).id;
|
||||
this.updateTabs();
|
||||
var action = {
|
||||
"type": "progressstatus",
|
||||
"progress_type": this.currentProgressType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue