josesalazar2025 commited on
Commit
15c6ffb
·
1 Parent(s): d8aaa23

Fix modal input overflow, papers modal mobile height, and default panel states

Browse files

- Add width/box-sizing to .modal-campo input to prevent apellido field overflow at wide resolutions
- Anchor papers modal to top on mobile using svh units so header and paginators stay visible
- Collapse panel-uri and panel-endo by default on first visit; panel-flujo stays expanded

Files changed (2) hide show
  1. css/styles.css +13 -0
  2. js/ui.js +8 -1
css/styles.css CHANGED
@@ -2276,6 +2276,8 @@ main {
2276
  }
2277
 
2278
  .modal-campo input {
 
 
2279
  padding: 8px 10px;
2280
  border: 1px solid var(--border-1);
2281
  border-radius: var(--radius-sm);
@@ -2605,3 +2607,14 @@ main {
2605
  opacity: 0.35;
2606
  cursor: not-allowed;
2607
  }
 
 
 
 
 
 
 
 
 
 
 
 
2276
  }
2277
 
2278
  .modal-campo input {
2279
+ width: 100%;
2280
+ box-sizing: border-box;
2281
  padding: 8px 10px;
2282
  border: 1px solid var(--border-1);
2283
  border-radius: var(--radius-sm);
 
2607
  opacity: 0.35;
2608
  cursor: not-allowed;
2609
  }
2610
+
2611
+ @media (max-width: 700px) {
2612
+ .modal-papers {
2613
+ top: var(--space-3);
2614
+ max-height: calc(100svh - var(--space-6));
2615
+ transform: translateX(-50%);
2616
+ }
2617
+ .modal-papers.visible {
2618
+ transform: translateX(-50%);
2619
+ }
2620
+ }
js/ui.js CHANGED
@@ -207,6 +207,8 @@ const GRUPOS_VINCULADOS = [
207
  ['panel-endo', 'panel-uri'],
208
  ];
209
 
 
 
210
  document.querySelectorAll('.btn-colapsar-subpanel').forEach(btn => {
211
  const subpanel = btn.closest('.subpanel');
212
  const animEl = subpanel.querySelector('.subpanel-anim');
@@ -219,7 +221,12 @@ document.querySelectorAll('.btn-colapsar-subpanel').forEach(btn => {
219
  animEl.style.height = `${animEl.scrollHeight}px`;
220
  }
221
 
222
- if (localStorage.getItem(claveAlmacenamiento) === '1') {
 
 
 
 
 
223
  subpanel.classList.add('collapsed');
224
  btn.setAttribute('aria-expanded', 'false');
225
  if (esRelleno) animEl.style.transition = 'none';
 
207
  ['panel-endo', 'panel-uri'],
208
  ];
209
 
210
+ const PANELES_COLAPSADOS_POR_DEFECTO = new Set(['panel-uri', 'panel-endo']);
211
+
212
  document.querySelectorAll('.btn-colapsar-subpanel').forEach(btn => {
213
  const subpanel = btn.closest('.subpanel');
214
  const animEl = subpanel.querySelector('.subpanel-anim');
 
221
  animEl.style.height = `${animEl.scrollHeight}px`;
222
  }
223
 
224
+ const valorGuardado = localStorage.getItem(claveAlmacenamiento);
225
+ const debeColapsar = valorGuardado !== null
226
+ ? valorGuardado === '1'
227
+ : PANELES_COLAPSADOS_POR_DEFECTO.has(subpanel.id);
228
+
229
+ if (debeColapsar) {
230
  subpanel.classList.add('collapsed');
231
  btn.setAttribute('aria-expanded', 'false');
232
  if (esRelleno) animEl.style.transition = 'none';