Sha256: 8c69f380c7f1c87e3227613ef796500e7e7b1dbc9aedfc4c1ddf09b6b961983f

Contents?: true

Size: 344 Bytes

Versions: 138

Compression:

Stored size: 344 Bytes

Contents

import { Controller } from 'stimulus'
import { useClickOutside } from 'stimulus-use'

export default class extends Controller {
  static targets = ['panel']

  connect() {
    useClickOutside(this)
  }

  clickOutside() {
    this.panelTarget.classList.add('hidden')
  }

  togglePanel() {
    this.panelTarget.classList.toggle('hidden')
  }
}

Version data entries

138 entries across 138 versions & 1 rubygems

Version Path
avo-1.22.2 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.22.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.22.1.pre.2 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.22.1.pre.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.22.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.22.0.pre.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.21.1.pre.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.21.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.20.2.pre.2 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.20.2.pre.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.21.0.pre.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.20.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.11 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.10 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.9 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.8 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.7 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.6 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.5 app/javascript/js/controllers/toggle_panel_controller.js
avo-1.19.1.pre.4 app/javascript/js/controllers/toggle_panel_controller.js