Fix: ocultar todas las secciones de tomas si no hay examen seleccionado
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
bf0fc39fee
commit
25ff224e5e
@@ -1312,8 +1312,8 @@ function _mpApplyExamVisibility(selectedExam) {
|
||||
var cid = el.getAttribute('data-campo-id');
|
||||
if (el.classList.contains('esquema-sep')) {
|
||||
if (sepToExam[cid] !== undefined) {
|
||||
// Separador de toma: mostrar solo si es del examen seleccionado
|
||||
inHidden = (sepToExam[cid] !== selectedExam);
|
||||
// Separador de toma: ocultar si no hay examen o si no coincide
|
||||
inHidden = (!selectedExam || sepToExam[cid] !== selectedExam);
|
||||
el.style.display = inHidden ? 'none' : '';
|
||||
} else {
|
||||
// Separador genérico (ej: Datos del paciente) — siempre visible
|
||||
@@ -1339,14 +1339,14 @@ document.addEventListener('change', function(e) {
|
||||
_mpShowCfgPanel(examName, groups);
|
||||
});
|
||||
|
||||
// Al cargar: aplicar visibilidad si hay examen seleccionado
|
||||
// Al cargar: aplicar visibilidad (sin examen = ocultar todo)
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var radio = document.querySelector('[name="_c8j2g16"]:checked');
|
||||
if (!radio) return;
|
||||
_mpApplyExamVisibility(radio.value);
|
||||
if (!_mpModoTurnero || _mpTomasConfig !== null) return;
|
||||
var groups = _mpGetGroupsForExam(radio.value);
|
||||
if (Object.keys(groups).length) _mpShowCfgPanel(radio.value, groups);
|
||||
var examName = radio ? radio.value : null;
|
||||
_mpApplyExamVisibility(examName); // null → oculta todas las secciones de tomas
|
||||
if (!_mpModoTurnero || _mpTomasConfig !== null || !examName) return;
|
||||
var groups = _mpGetGroupsForExam(examName);
|
||||
if (Object.keys(groups).length) _mpShowCfgPanel(examName, groups);
|
||||
});
|
||||
|
||||
// Botón "Usar todas"
|
||||
|
||||
Reference in New Issue
Block a user