fix(modal): limpa selecao e esconde barra de acoes ao fechar modal, previne overflow vertical

This commit is contained in:
VPS 4 Builder
2026-05-25 01:59:29 +02:00
parent 1dd7360634
commit 1737e5a145
3 changed files with 10 additions and 3 deletions
+7 -1
View File
@@ -186,10 +186,14 @@ function setupEventListeners() {
// Transform modal close on backdrop
transformModal.addEventListener('click', e => {
if (e.target === transformModal) transformModal.classList.remove('active');
if (e.target === transformModal) {
transformModal.classList.remove('active');
if (typeof clearTransformSelection === 'function') clearTransformSelection();
}
});
document.getElementById('closeTransformModal').addEventListener('click', () => {
transformModal.classList.remove('active');
if (typeof clearTransformSelection === 'function') clearTransformSelection();
});
}
@@ -551,6 +555,8 @@ async function showTransformModal(imageId) {
if (!image) {
throw new Error('Imagem não encontrada localmente');
}
if (typeof clearTransformSelection === 'function') clearTransformSelection();
// Se existir thumb_filename, usar ele; caso contrário, fallback para a imagem cheia
const imageUrl = image.thumb_filename ? `/uploads/${image.thumb_filename}` : `/uploads/${image.filename}`;