Sha256: 32cee4238bc3259bf44e7e9a4647e3bcec1c74da29f47cf3bb2389551b299ee1

Contents?: true

Size: 519 Bytes

Versions: 2

Compression:

Stored size: 519 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

// Connects to data-controller="slim-select"
export default class extends Controller {
  connect() {
    console.log(`slim-select connected: ${this.element}`)
    this.slimSelect = new SlimSelect({
      select: this.element
    })
    this.element.setAttribute("data-action", "turbo:morph-element->slim-select#reconnect")
  }

  disconnect() {
    this.slimSelect.destroy()
    this.slimSelect = null
  }

  reconnect() {
    this.disconnect()
    this.connect()
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plutonium-0.16.3 src/js/controllers/slim_select_controller.js
plutonium-0.16.1 src/js/controllers/slim_select_controller.js