mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix watched indicators and "More" button not appearing on card overlays (closes #23)
This commit is contained in:
1 parent
8b0436a73e
commit
b65144e09f
2 files changed
+33
-2
No files matched your search
@@ -401,6 +401,19 @@
|
||||
cardImageContainer.appendChild(iconSpan);
|
||||
}
|
||||
|
||||
if (item.UserData?.Played) {
|
||||
const cardIndicators = document.createElement('div');
|
||||
cardIndicators.className = 'cardIndicators';
|
||||
const playedIndicator = document.createElement('div');
|
||||
playedIndicator.className = 'playedIndicator indicator';
|
||||
const playedIndicatorIcon = document.createElement('span');
|
||||
playedIndicatorIcon.className = 'material-icons indicatorIcon check';
|
||||
playedIndicatorIcon.setAttribute('aria-hidden', 'true');
|
||||
playedIndicator.appendChild(playedIndicatorIcon);
|
||||
cardIndicators.appendChild(playedIndicator);
|
||||
cardImageContainer.appendChild(cardIndicators);
|
||||
}
|
||||
|
||||
// Card overlay container
|
||||
const cardOverlayContainer = document.createElement('div');
|
||||
cardOverlayContainer.className = 'cardOverlayContainer itemAction';
|
||||
@@ -463,6 +476,19 @@
|
||||
favoriteButton.appendChild(favoriteIcon);
|
||||
buttonContainer.appendChild(favoriteButton);
|
||||
|
||||
const moreButton = document.createElement('button');
|
||||
moreButton.setAttribute('is', 'paper-icon-button-light');
|
||||
moreButton.className = 'cardOverlayButton cardOverlayButton-hover itemAction paper-icon-button-light';
|
||||
moreButton.setAttribute('data-action', 'menu');
|
||||
moreButton.title = 'More';
|
||||
const moreIcon = document.createElement('span');
|
||||
moreIcon.className = 'material-icons cardOverlayButtonIcon cardOverlayButtonIcon-hover more_vert';
|
||||
moreIcon.setAttribute('aria-hidden', 'true');
|
||||
moreButton.appendChild(moreIcon);
|
||||
|
||||
buttonContainer.appendChild(moreButton);
|
||||
|
||||
|
||||
// Assemble overlay
|
||||
cardOverlayContainer.appendChild(overlayLink);
|
||||
cardOverlayContainer.appendChild(playButton);
|
||||
|
||||
@@ -6852,8 +6852,13 @@ In the Custom Tabs plugin, add a new tab with the following HTML content:
|
||||
}
|
||||
}
|
||||
|
||||
// Add the watchlist button to the button container
|
||||
buttonContainer.appendChild(watchlistButton);
|
||||
// Add the watchlist button to the button container, right before the play state button if it exists
|
||||
const playStateButton = buttonContainer.querySelector('button[is="emby-playstatebutton"]');
|
||||
if (playStateButton) {
|
||||
buttonContainer.insertBefore(watchlistButton, playStateButton);
|
||||
} else {
|
||||
buttonContainer.appendChild(watchlistButton);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to process all existing overlay containers
|
||||
|
||||
Reference in new issue
Block a user