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();
|
||||
CodeOceanEditorTips.initializeEventHandlers();
|
||||
|
||||
window.addEventListener("turbolinks:before-render", this.unloadAutoSave.bind(this));
|
||||
window.addEventListener("beforeunload", this.unloadAutoSave.bind(this));
|
||||
// create autosave when the editor is opened the first time
|
||||
this.autosave();
|
||||
|
Reference in New Issue
Block a user