Sha256: f87709b71f113eb063a8b3a151e6e14a78491fbe9cb953a9248a64f46c236108

Contents?: true

Size: 305 Bytes

Versions: 51

Compression:

Stored size: 305 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

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

  open() {
    this.detailsTarget.open = true
  }

  close() {
    this.detailsTarget.open = false
  }

  toggle() {
    this.detailsTarget.open ? this.close() : this.open()
  }
}

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
css-zero-0.0.28 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.27 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.26 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.25 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.24 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.23 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.22 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.21 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.20 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.19 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
css-zero-0.0.18 lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js