This commit is contained in:
17
app/javascript/controllers/form_controller.js
Normal file
17
app/javascript/controllers/form_controller.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = [ "cancel" ]
|
||||
|
||||
submit() {
|
||||
this.element.requestSubmit()
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.cancelTarget?.click()
|
||||
}
|
||||
|
||||
preventAttachment(event) {
|
||||
event.preventDefault()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user