diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 9ce3d9b..5431c65 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -1906,6 +1906,9 @@ function _mpRefreshCards(signedFid, nextFid) { document.addEventListener('DOMContentLoaded', function() { _mpRenderCards(); setTimeout(function() { + var hayFirmaIniciada = Object.keys(window._mpSavedFirmas || {}).length > 0 + || !!document.querySelector('.firma-box img'); + if (!hayFirmaIniciada) return; var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])'); if (fw) { fw.scrollIntoView({ behavior: 'smooth', block: 'start' }); @@ -2589,7 +2592,10 @@ const topaz = (() => { // Toma progresiva: scroll a la primera firma pendiente if (window._muestrasMap) { setTimeout(function() { - var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])'); + var hayFirmaIniciada = Object.keys(window._mpSavedFirmas || {}).length > 0 + || !!document.querySelector('.firma-box img'); + var fw = hayFirmaIniciada + ? document.querySelector('.firma-pro-widget:not([style*="display:none"])') : null; if (fw) { fw.scrollIntoView({ behavior: 'smooth', block: 'start' }); } else if (evt) {