Gui improvements, ordering
This commit is contained in:
parent
6db0b64f4c
commit
42c077f6ab
28 changed files with 105 additions and 40 deletions
|
|
@ -4,14 +4,21 @@ const LEAVE_ALERT = "Es gibt ungespeicherte Änderungen! Wirklich verlassen?"
|
|||
|
||||
// Connects to data-controller="unsaved-changes"
|
||||
export default class extends Controller {
|
||||
static targets = ["cancel"]
|
||||
|
||||
initialState = null
|
||||
|
||||
connect() {
|
||||
this.initialState = this.formState()
|
||||
console.log(this.cancelTargets)
|
||||
|
||||
window.addEventListener("beforeunload", (event) => this.leavingPage(event))
|
||||
document.addEventListener('turbo:before-visit', (e) => this.leavingPage(e))
|
||||
this.element.addEventListener("submit", (_) => this.initialState = null)
|
||||
this.cancelTargets.forEach(element => {
|
||||
console.log(element)
|
||||
element.addEventListener("onclick", (_) => this.initialState = null)
|
||||
});
|
||||
}
|
||||
|
||||
formState() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue