ver_formulario_enviado: auto-fill hora on Minuto 0 (fresh form)

_mpAutoFillHora was gated behind hayFirmaIniciada, so it never ran
on a fresh form where no signatures exist yet. Now always fills the
hora field of the first visible firma widget; scroll only when at
least one signature has already been saved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 17:36:01 -05:00
co-authored by Claude Sonnet 4.6
parent 7a08e63e44
commit 17c9e1a1f2
+6 -4
View File
@@ -1963,13 +1963,15 @@ function _mpRefreshCards(signedFid, nextFid) {
document.addEventListener('DOMContentLoaded', function() {
_mpRenderCards();
setTimeout(function() {
var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])');
if (!fw) return;
// Siempre auto-llenar la hora (incluso en Minuto 0 sin firmas previas)
_mpAutoFillHora(fw.dataset.campo);
// Solo hacer scroll si ya hay alguna firma iniciada
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) {
if (hayFirmaIniciada) {
fw.scrollIntoView({ behavior: 'smooth', block: 'start' });
_mpAutoFillHora(fw.dataset.campo);
}
}, 350);
});