mirror of
https://github.com/stashapp/stash.git
synced 2026-01-03 22:24:41 +01:00
Update marker background color logic to use primaryTag name instead of title (#6141)
This commit is contained in:
parent
97ca5a28d3
commit
cb6c53deb5
1 changed files with 14 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ export interface IMarker {
|
|||
title: string;
|
||||
seconds: number;
|
||||
end_seconds?: number | null;
|
||||
primaryTag: { name: string };
|
||||
}
|
||||
|
||||
interface IMarkersOptions {
|
||||
|
|
@ -85,8 +86,13 @@ class MarkersPlugin extends videojs.getPlugin("plugin") {
|
|||
markerSet.dot.toggleAttribute("marker-tooltip-shown", true);
|
||||
|
||||
// Set background color based on tag (if available)
|
||||
if (marker.title && this.tagColors[marker.title]) {
|
||||
markerSet.dot.style.backgroundColor = this.tagColors[marker.title];
|
||||
if (
|
||||
marker.primaryTag &&
|
||||
marker.primaryTag.name &&
|
||||
this.tagColors[marker.primaryTag.name]
|
||||
) {
|
||||
markerSet.dot.style.backgroundColor =
|
||||
this.tagColors[marker.primaryTag.name];
|
||||
}
|
||||
markerSet.dot.addEventListener("mouseenter", () => {
|
||||
this.showMarkerTooltip(marker.title);
|
||||
|
|
@ -152,8 +158,12 @@ class MarkersPlugin extends videojs.getPlugin("plugin") {
|
|||
rangeDiv.style.display = "none"; // Initially hidden
|
||||
|
||||
// Set background color based on tag (if available)
|
||||
if (marker.title && this.tagColors[marker.title]) {
|
||||
rangeDiv.style.backgroundColor = this.tagColors[marker.title];
|
||||
if (
|
||||
marker.primaryTag &&
|
||||
marker.primaryTag.name &&
|
||||
this.tagColors[marker.primaryTag.name]
|
||||
) {
|
||||
rangeDiv.style.backgroundColor = this.tagColors[marker.primaryTag.name];
|
||||
}
|
||||
|
||||
markerSet.range = rangeDiv;
|
||||
|
|
|
|||
Loading…
Reference in a new issue