Sha256: 0a12056a0e7a303909aac0b49643027512ef4bbe8ede3c5be1c74ecd4fc782c3
Contents?: true
Size: 1 KB
Versions: 124
Compression:
Stored size: 1 KB
Contents
import { Controller } from '@hotwired/stimulus' import Cookies from './../utils/cookies' import { fadeOut, fadeIn } from './../utils/utils' export default class extends Controller { connect () { if (document.getElementById('sidebar').classList.contains('opened')) { const brand = document.querySelector('.navbar .navbar-brand') if (brand) brand.style.visibility = 'hidden' } } expandNavbar (e) { const icon = this.element.querySelector('i') if (document.getElementById('sidebar').classList.toggle('opened')) { icon.classList.add('bi-chevron-left') icon.classList.remove('bi-chevron-right') fadeOut(document.querySelector('.navbar .navbar-brand')) } else { icon.classList.remove('bi-chevron-left') icon.classList.add('bi-chevron-right') fadeIn(document.querySelector('.navbar .navbar-brand')) } const isOpened = document.getElementById('sidebar').classList.contains('opened') new Cookies().setCookie('navbar_expand', isOpened, 30) } }
Version data entries
124 entries across 124 versions & 1 rubygems