Agregada persistencia del estado de la barra lateral

This commit is contained in:
Araozu 2020-07-29 08:08:14 -05:00
parent cfead45f2f
commit 581028261a
2 changed files with 10 additions and 4 deletions

View File

@ -23,10 +23,13 @@ div.contenedor(:style="anchoBarraLateral")
import barraLateral from "./components/App/barra-lateral.vue"
import YAML from "yaml"
obtenerEstadoBarraLateralOculta = =>
(localStorage?.getItem "barra-oculta") == "true"
setup = =>
store = useStore()
barraLateralOculta = ref false
barraLateralOculta = ref (obtenerEstadoBarraLateralOculta())
alto = computed (=> store.state.altoPantalla)
ancho = computed (=> store.state.anchoPantalla)
año = computed (=> store.state.año)
@ -40,7 +43,10 @@ div.contenedor(:style="anchoBarraLateral")
{gridTemplateColumns: "20rem auto"}
)
cambiarEstadoBarraLateral = => barraLateralOculta.value = !barraLateralOculta.value
cambiarEstadoBarraLateral = =>
nuevoVal = !barraLateralOculta.value
localStorage?.setItem "barra-oculta", nuevoVal
barraLateralOculta.value = nuevoVal
setTimeout (=>
resRaw = await fetch "/horarios/#{año.value}_#{periodo.value}_#{facultad.value}_#{escuela.value}.yaml"

View File

@ -1,4 +1,4 @@
import Vuex from 'vuex'
import {createStore} from 'vuex'
const cambiarModoColor = modo => {
const clases = document.body.classList;
@ -21,7 +21,7 @@ const cambiarModoColor = modo => {
clases.add(modo);
};
export default Vuex.createStore({
export default createStore({
state: {
celdas: {},
horarioUsuario: {},