Disable play button until item is tagged, instead of hiding it

This commit is contained in:
Jarian Cottingham 2026-02-21 15:45:59 -06:00
parent a787536297
commit 3f837ccf94

View File

@ -90,7 +90,7 @@ function displayFiles(files) {
<span class="tag-icon extra-tag" data-file-path="${file.path}" title="Mark as Extra">🏷</span>
<span class="tag-icon commentary-tag" data-file-path="${file.path}" title="Add Commentary">💬</span>
<span class="video-preview-btn" data-file-path="${file.path}" title="Preview Video">🎬</span>
<button class="play-button" style="visibility: hidden; width: 0; margin: 0; padding: 0; flex-shrink: 0;" data-file-path="${file.path}"></button>
<button class="play-button" style="opacity: 0.3; cursor: default; flex-shrink: 0;" data-file-path="${file.path}" disabled></button>
</div>
`;
@ -240,13 +240,13 @@ function addTagToEpisode(filePath, tagType) {
// Add a data attribute to track that this file is tagged
item.setAttribute('data-tagged-' + tagType, 'true');
// Show the play button (make it visible instead of creating a new one)
// Enable the play button
const playButton = item.querySelector('.play-button');
if (playButton) {
playButton.style.visibility = 'visible';
playButton.style.width = 'auto';
playButton.style.padding = '0 5px';
playButton.style.marginLeft = '10px';
playButton.style.opacity = '1';
playButton.style.cursor = 'pointer';
playButton.disabled = false;
playButton.style.pointerEvents = 'auto';
}
}
}
@ -283,13 +283,13 @@ function untagFile(filePath, tagType) {
// Remove the data attribute
item.removeAttribute('data-tagged-' + tagType);
// Hide the play button when untagging
// Disable the play button when untagging
const playButton = item.querySelector('.play-button');
if (playButton) {
playButton.style.visibility = 'hidden';
playButton.style.width = '0';
playButton.style.padding = '0';
playButton.style.margin = '0';
playButton.style.opacity = '0.3';
playButton.style.cursor = 'default';
playButton.disabled = true;
playButton.style.pointerEvents = 'none';
}
}
}