18 lines
435 B
JavaScript
18 lines
435 B
JavaScript
import { Controller } from '@hotwired/stimulus'
|
|
|
|
export default class extends Controller {
|
|
static targets = [ 'form', 'title', 'content' ]
|
|
|
|
show({ action, title, content }) {
|
|
this.formTarget.action = action
|
|
this.titleTarget.innerText = title
|
|
this.contentTarget.innerHTML = content
|
|
this.element.classList.remove('hidden')
|
|
}
|
|
|
|
hide() {
|
|
this.element.classList.add('hidden')
|
|
}
|
|
|
|
}
|