Unload autosave on turbolinks page render.
We cannot use turbolinks:request-start because this will duplicate code (if a page is first requested by turbolinks and afterwards by a full page reload)
This commit is contained in:
@ -889,6 +889,7 @@ var CodeOceanEditor = {
|
|||||||
this.initializeDeadlines();
|
this.initializeDeadlines();
|
||||||
CodeOceanEditorTips.initializeEventHandlers();
|
CodeOceanEditorTips.initializeEventHandlers();
|
||||||
|
|
||||||
|
window.addEventListener("turbolinks:before-render", this.unloadAutoSave.bind(this));
|
||||||
window.addEventListener("beforeunload", this.unloadAutoSave.bind(this));
|
window.addEventListener("beforeunload", this.unloadAutoSave.bind(this));
|
||||||
// create autosave when the editor is opened the first time
|
// create autosave when the editor is opened the first time
|
||||||
this.autosave();
|
this.autosave();
|
||||||
|
Reference in New Issue
Block a user