Sha256: 9242890c8a590cd847b0733e3d7d2d1af9f020f8dd09f689d42ee9249d21c7ab

Contents?: true

Size: 360 Bytes

Versions: 16

Compression:

Stored size: 360 Bytes

Contents

import { Controller } from '@hotwired/stimulus'
import Cookies from './cookies'

export default class extends Controller {
  expandNavbar (e) {
    document.getElementById('sidebar').classList.toggle('opened')
    const isOpened = document.getElementById('sidebar').classList.contains('opened')
    new Cookies().setCookie('navbar_expand', isOpened, 30)
  }
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pg_rails-7.0.8.pre.alpha.14 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.13 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.12 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.11 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.10 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.9 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.8 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.7 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha.6 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.8.pre.alpha pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.7 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.6 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.5 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.4 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.3 pg_layout/app/javascript/navbar_controller.js
pg_rails-7.0.2 pg_layout/app/javascript/navbar_controller.js