Sha256: 5bcca678e401b2c0a47870b091bc7338676178636f95e90249524a35c5f0961f

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

import { BridgeComponent } from "@hotwired/strada"

// Connects to data-controller="bridge--<%= @attribute %>"
export default class extends BridgeComponent {
  static component = "<%= @attribute %>"

  connect() {
    super.connect()
    this.notifyBridgeOfConnect()
  }

  notifyBridgeOfConnect() {
    const title = this.bridgeElement.title

    this.send("connect", { title }, () => {
      this.element.click()
    })
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
strada-rails-0.0.5 lib/generators/strada/templates/controller.js.tt
strada-rails-0.0.4 lib/generators/strada/templates/controller.js.tt
strada-rails-0.0.3 lib/generators/strada/templates/controller.js.tt
strada-rails-0.0.2 lib/generators/strada/templates/controller.js.tt
strada-rails-0.0.1 lib/generators/strada/templates/controller.js.tt