Sha256: 7c5404175983c55d97029641a07f7763cecfa58d7e5d94d070b26dc6c5609ba5

Contents?: true

Size: 380 Bytes

Versions: 12

Compression:

Stored size: 380 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

// Connects to data-controller="select-navigator"
export default class extends Controller {
  static targets = ["select"]

  navigate(_) {
    const url = this.selectTarget.value
    const anchor = document.createElement('a')
    anchor.href = url

    this.element.appendChild(anchor)
    anchor.click()
    anchor.remove()
  }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
plutonium-0.19.2 src/js/controllers/select_navigator.js
plutonium-0.19.1 src/js/controllers/select_navigator.js
plutonium-0.19.0 src/js/controllers/select_navigator.js
plutonium-0.18.8 src/js/controllers/select_navigator.js
plutonium-0.18.7 src/js/controllers/select_navigator.js
plutonium-0.18.6 src/js/controllers/select_navigator.js
plutonium-0.18.5 src/js/controllers/select_navigator.js
plutonium-0.18.4 src/js/controllers/select_navigator.js
plutonium-0.18.3 src/js/controllers/select_navigator.js
plutonium-0.18.2 src/js/controllers/select_navigator.js
plutonium-0.18.1 src/js/controllers/select_navigator.js
plutonium-0.18.0 src/js/controllers/select_navigator.js