Sha256: 367f047b8fcebd4012fa31fe86222cd2690936be6cd1d7a0b607e1215a18a2a5

Contents?: true

Size: 529 Bytes

Versions: 4

Compression:

Stored size: 529 Bytes

Contents

import ApplicationController from './application_controller'

export default class extends ApplicationController {
  static targets = ["item"]

  static values = {
    attribute: String
  }

  toggle () {
    this.itemTargets.forEach((item) => {
      item[this.attributeValue] = !item[this.attributeValue]
    })
  }

  set () {
    this.itemTargets.forEach((item) => {
      item[this.attributeValue] = true
    })
  }

  unset () {
    this.itemTargets.forEach((item) => {
      item[this.attributeValue] = false
    })
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

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