Sha256: a01dee57a683678b189af7cea8d6a6d8b7df53612b73ae1eb445a5cf4eba4cdd

Contents?: true

Size: 354 Bytes

Versions: 194

Compression:

Stored size: 354 Bytes

Contents

import { Controller } from '@hotwired/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

194 entries across 194 versions & 1 rubygems

Version Path
avo-2.53.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.52.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.49.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.48.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.47.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.46.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.45.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.44.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.43.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.42.2 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.42.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.42.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.41.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.40.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.39.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.38.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.37.2 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.37.1 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.37.0 app/javascript/js/controllers/toggle_panel_controller.js
avo-2.36.3 app/javascript/js/controllers/toggle_panel_controller.js