Sha256: eadbc83da75d7026e4e8bc6fcccfe9a20af91800596edd735c6adcfbf8193a9b

Contents?: true

Size: 757 Bytes

Versions: 4

Compression:

Stored size: 757 Bytes

Contents

import ApplicationController from './application_controller'

export default class extends ApplicationController {
  show () {
    this.wrapperController.animate()
    document.body.classList.add('mobile-nav-expanded')
  }

  hide () {
    this.wrapperController.animate()
    document.body.classList.remove('mobile-nav-expanded')
  }

  toggle () {
    this.wrapperController.animate()
    document.body.classList.toggle('mobile-nav-expanded')
  }

  get isExpanded () {
    return document.body.classList.contains('mobile-nav-expanded')
  }

  get wrapperElement () {
    return document.getElementById('app-wrapper')
  }

  get wrapperController () {
    return this.application.getControllerForElementAndIdentifier(this.wrapperElement, 'wrapper')
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.10.1 frontend/js/controllers/mobile_sidebar_controller.js
trestle-0.10.0 frontend/js/controllers/mobile_sidebar_controller.js
trestle-0.10.0.pre2 frontend/js/controllers/mobile_sidebar_controller.js
trestle-0.10.0.pre frontend/js/controllers/mobile_sidebar_controller.js