Links, mainly...
This commit is contained in:
parent
fd42a3f173
commit
21ab02d647
69 changed files with 2258 additions and 155 deletions
19
app/javascript/controllers/check_link_controller.js
Normal file
19
app/javascript/controllers/check_link_controller.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
// Connects to data-controller="check-link"
|
||||
export default class extends Controller {
|
||||
static targets = ["input", "button"]
|
||||
|
||||
connect() {
|
||||
console.log("connect", this.inputTarget, this.buttonTarget)
|
||||
this.inputTarget.addEventListener("input", e => this.onUrlInputChange(e))
|
||||
}
|
||||
|
||||
onUrlInputChange(event) {
|
||||
console.log("connect", this.inputTarget, this.buttonTarget)
|
||||
console.log(event, this.buttonTarget)
|
||||
this.buttonTarget.href = this.inputTarget.value;
|
||||
this.buttonTarget.innerHTML = this.inputTarget.value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue