diff --git a/dental-server/public/app.js b/dental-server/public/app.js index 52e84c6..3b3f0c6 100644 --- a/dental-server/public/app.js +++ b/dental-server/public/app.js @@ -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}`; diff --git a/dental-server/public/index.html b/dental-server/public/index.html index bfe1d31..242edbd 100644 --- a/dental-server/public/index.html +++ b/dental-server/public/index.html @@ -6,7 +6,7 @@