fix(ui): show title tooltips on disabled showcase media control buttons

This commit is contained in:
Will Miao
2026-06-03 20:33:58 +08:00
parent c8beaa64e1
commit 1beef5dea9
3 changed files with 10 additions and 4 deletions

View File

@@ -157,9 +157,9 @@ async function checkImportedRecipes(container) {
recipeButtons.forEach(btn => {
const id = btn.dataset.imageId;
if (id && data.results[id]?.in_library) {
btn.disabled = true;
btn.title = 'Already imported as recipe';
btn.classList.add('disabled');
btn.setAttribute('aria-disabled', 'true');
}
});
} catch (err) {
@@ -510,6 +510,11 @@ export function initMediaControlHandlers(container) {
btn.addEventListener('click', async function(e) {
e.stopPropagation();
// Ignore clicks when disabled
if (this.classList.contains('disabled')) {
return;
}
const imageMetaRaw = this.dataset.imageMeta;
const imageUrl = this.dataset.imageUrl;
const imageNsfw = this.dataset.imageNsfw;