From e4a08f5aed45c7b8e61ba4704eadfd3d56022827 Mon Sep 17 00:00:00 2001 From: nat Date: Wed, 18 May 2022 17:46:47 -0300 Subject: [PATCH] Chismosa scrollablre --- public/css/app.css | 22 +++++++++++++++++++++- public/js/chismosa.js | 16 ++++++++-------- resources/views/layouts/app.blade.php | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 4dc944a..8f03d64 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -21,13 +21,33 @@ nav.breadcrumb.is-fixed-top { right: 0; z-index: 30; top: 3.25rem; + height: 3.25rem; } main.has-top-padding { - padding-top: 3rem !important; + padding-top: 4.5rem !important; } .has-text-centered { text-align: center; margin: 0 1em; } + +.is-fixed-top { + position: fixed; + z-index: 30; +} + +.chismosa-container { + top: 6.5rem; + max-height: 21rem; + overflow-y: scroll; + overflow-x: hidden; + width: 100%; + position: fixed; + z-index: 15; +} + +main.chisma-abierta { + padding-top: 25.5rem !important; +} \ No newline at end of file diff --git a/public/js/chismosa.js b/public/js/chismosa.js index c1c64b4..61439c2 100644 --- a/public/js/chismosa.js +++ b/public/js/chismosa.js @@ -1,6 +1,6 @@ Vue.component('chismosa', { template: ` -
+
@@ -39,23 +39,19 @@ Vue.component('chismosa', { subpedido: { productos:[] }, + init: true, visible: false } }, computed: { - /* TODO: tener el camino que se había hecho antes de abrir la chismosa para volver atrás */ - miga: function() { - return { - nombre: "Chismosa de " + this.subpedido.nombre, - href: "/chismosa" - } + animation: function() { + return this.visible ? "animate__slideInDown" : "animate__slideOutUp"; } }, beforeCreate() { axios.get("/subpedidos/obtener_sesion").then(response => { this.subpedido = response.data.subpedido; this.fetchSubpedido(); - Event.$emit("migas-agregar",this.miga); }); }, methods: { @@ -71,7 +67,11 @@ Vue.component('chismosa', { this.fetchSubpedido(); }); Event.$on('toggle-chismosa', () => { + this.init = false; this.visible = !this.visible; + var main = document.getElementById("main"); + if (this.visible) main.classList.add("chisma-abierta"); + else main.classList.remove("chisma-abierta"); }); } }); diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1e26869..eb9acb0 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -40,7 +40,7 @@ -
+
@yield('content')