mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Clean up hardcoded values and improve readability
This commit is contained in:
@@ -21,6 +21,10 @@ export default class extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.removeUnloadEvent();
|
||||
}
|
||||
|
||||
login() {
|
||||
window.dispatchEvent(new Event("login:modal:open"));
|
||||
}
|
||||
@@ -40,10 +44,8 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
handlePageUnload(event) {
|
||||
event.preventDefault()
|
||||
|
||||
event.returnValue = 'I18n.t("admin.unsaved_confirm_leave")';
|
||||
return
|
||||
event.preventDefault();
|
||||
event.returnValue = I18n.t("admin.unsaved_confirm_leave");
|
||||
}
|
||||
|
||||
removeUnloadEvent() {
|
||||
@@ -51,8 +53,4 @@ export default class extends Controller {
|
||||
window.removeEventListener('beforeunload', this.handlePageUnload);
|
||||
}
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.removeUnloadEvent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user