WIP Relay editing UI
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = [ "list", "template" ]
|
||||
|
||||
add (event) {
|
||||
event.preventDefault()
|
||||
const row = this.templateTarget.content.cloneNode(true)
|
||||
this.listTarget.appendChild(row)
|
||||
}
|
||||
|
||||
remove (event) {
|
||||
event.preventDefault()
|
||||
const row = event.target.closest("li")
|
||||
row.remove()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user