From 9601acaa0f9c180329a237c1b847760e1c65bb5a Mon Sep 17 00:00:00 2001 From: Matias Bais Date: Thu, 18 Apr 2024 17:49:52 -0300 Subject: [PATCH] =?UTF-8?q?fix=20en=20tablas=20sin=20paginaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/static/componentes/tabla.js | 3 +- frontend/static/componentes/titulo.js | 64 +++++++++++++-------------- frontend/static/main.scss | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/frontend/static/componentes/tabla.js b/frontend/static/componentes/tabla.js index fc3c749..6b3e2b8 100644 --- a/frontend/static/componentes/tabla.js +++ b/frontend/static/componentes/tabla.js @@ -33,7 +33,8 @@ class Tabla { // TODO Feature: Conseguir la cantidad de páginas. Quizá con otra consulta... let tabla = document.getElementById(this.#id); let fieldset = tabla.querySelector('tfoot fieldset'); - fieldset.className = 'fieldset-paginacion'; + if (this.#mostrarPaginacion) + fieldset.className = 'fieldset-paginacion'; fetch(this.#endpointPaginacion, { credentials: 'include', diff --git a/frontend/static/componentes/titulo.js b/frontend/static/componentes/titulo.js index f6de34f..ce39c4a 100644 --- a/frontend/static/componentes/titulo.js +++ b/frontend/static/componentes/titulo.js @@ -1,39 +1,39 @@ class Titulo { - titulo; - elemento; - #tipo - #clases - id + titulo; + elemento; + #tipo + #clases + id - constructor(elemento = 'h1', clave, titulo, clases,id) { + constructor(elemento = 'h1', clave, titulo, clases, id) { - this.#tipo = { - '1': 'is-1', - '2': 'is-2', - '3': 'is-3', - '4': 'is-4', - '5': 'is-5', - '6': 'is-6' - }[clave]; + this.#tipo = { + '1': 'is-1', + '2': 'is-2', + '3': 'is-3', + '4': 'is-4', + '5': 'is-5', + '6': 'is-6' + }[clave]; - // this.#elemento = { - // '1': 'h1', - // '2': 'h2', - // '3': 'h3', - // '4': 'h4', - // '5': 'h5' - // }[clave]; - this.elemento = elemento; - this.titulo = titulo; - this.#clases = clases || ''; - this.id=id; - } + // this.#elemento = { + // '1': 'h1', + // '2': 'h2', + // '3': 'h3', + // '4': 'h4', + // '5': 'h5' + // }[clave]; + this.elemento = elemento; + this.titulo = titulo; + this.#clases = clases || ''; + this.id = id; + } - render() { - return ` - <${this.elemento} class='title ${this.#tipo} ${this.#clases}' ${this.id?`id="${this.id}"`:''}>${this.titulo} + render() { + return ` + <${this.elemento} class='title ${this.#tipo} ${this.#clases}' ${this.id ? `id="${this.id}"` : ''}>${this.titulo} `; - } } - -export {Titulo}; +} + +export { Titulo }; diff --git a/frontend/static/main.scss b/frontend/static/main.scss index aae22be..57b5835 100644 --- a/frontend/static/main.scss +++ b/frontend/static/main.scss @@ -893,7 +893,7 @@ form > fieldset{ margin-right: auto; border: 2px solid #f2f2f2; overflow: hidden; - overflow-x: scroll; + overflow-x: auto; scroll-behavior: smooth; margin-bottom: 1rem; padding-bottom: 1rem;