Commit 77fe779f authored by Jacob Schatz's avatar Jacob Schatz

Remove Event listener and make code more readable.

parent 89c3c88e
...@@ -153,10 +153,13 @@ ...@@ -153,10 +153,13 @@
return !!this.state.updatedAt; return !!this.state.updatedAt;
}, },
issueChanged() { issueChanged() {
return this.initialDescriptionText let descriptionChanged =
!== this.store.formState.description this.initialDescriptionText !== this.store.formState.description;
|| this.initialTitleText
!== this.store.formState.title; let titleChanged =
this.initialTitleText !== this.store.formState.title;
return descriptionChanged || titleChanged;
}, },
}, },
created() { created() {
...@@ -194,6 +197,7 @@ ...@@ -194,6 +197,7 @@
eventHub.$off('update.issuable', this.updateIssuable); eventHub.$off('update.issuable', this.updateIssuable);
eventHub.$off('close.form', this.closeForm); eventHub.$off('close.form', this.closeForm);
eventHub.$off('open.form', this.openForm); eventHub.$off('open.form', this.openForm);
window.removeEventListener('beforeunload', this.handleBeforeUnloadEvent);
}, },
methods: { methods: {
handleBeforeUnloadEvent(e) { handleBeforeUnloadEvent(e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment