mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 12:39:23 -03:00
fix(ui): show title tooltips on disabled showcase media control buttons
This commit is contained in:
@@ -141,8 +141,9 @@
|
||||
border-color: var(--lora-error);
|
||||
}
|
||||
|
||||
/* Disabled state for delete button */
|
||||
.media-control-btn.example-delete-btn.disabled {
|
||||
/* Disabled state for delete and create-recipe buttons */
|
||||
.media-control-btn.example-delete-btn.disabled,
|
||||
.media-control-btn.create-recipe-btn.disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -256,7 +256,7 @@ function renderMediaItem(img, index, exampleFiles) {
|
||||
<button class="media-control-btn example-delete-btn ${!isCustomImage ? 'disabled' : ''}"
|
||||
title="${isCustomImage ? 'Delete this example' : 'Only custom images can be deleted'}"
|
||||
data-short-id="${img.id || ''}"
|
||||
${!isCustomImage ? 'disabled' : ''}>
|
||||
${!isCustomImage ? 'aria-disabled="true"' : ''}>
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
<i class="fas fa-check confirm-icon"></i>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user