Sha256: c39dcc9b3e53349a7cb445121cc8d86b5e9890589f93d8a528dd8d562ca8c406

Contents?: true

Size: 356 Bytes

Versions: 9

Compression:

Stored size: 356 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = [ "menu" ]

  show() {
    this.menuTarget.show()
  }

  showModal() {
    this.menuTarget.showModal()
  }

  close() {
    this.menuTarget.close()
  }

  closeOnClickOutside({ target }) {
    if (target.nodeName === "DIALOG") this.close()
  }
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
css-zero-0.0.44 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.43 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.42 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.41 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.40 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.39 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.38 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.37 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
css-zero-0.0.36 lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js