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:
co-authored by
Claude Sonnet 4.6
parent
7a08e63e44
commit
17c9e1a1f2
@@ -1963,13 +1963,15 @@ function _mpRefreshCards(signedFid, nextFid) {
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
_mpRenderCards();
|
_mpRenderCards();
|
||||||
setTimeout(function() {
|
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
|
var hayFirmaIniciada = Object.keys(window._mpSavedFirmas || {}).length > 0
|
||||||
|| !!document.querySelector('.firma-box img');
|
|| !!document.querySelector('.firma-box img');
|
||||||
if (!hayFirmaIniciada) return;
|
if (hayFirmaIniciada) {
|
||||||
var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])');
|
|
||||||
if (fw) {
|
|
||||||
fw.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
fw.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
_mpAutoFillHora(fw.dataset.campo);
|
|
||||||
}
|
}
|
||||||
}, 350);
|
}, 350);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user