diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 4b4c8810..2c0696e4 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -833,8 +833,7 @@ var CodeOceanEditor = { this.initializeDeadlines(); CodeOceanEditorTips.initializeEventHandlers(); - window.addEventListener("beforeunload", this.unloadAutoSave.bind(this)); - window.addEventListener("page:before-change", this.unloadAutoSave.bind(this)); + window.addEventListener("turbolinks:request-start", this.unloadAutoSave.bind(this)); // create autosave when the editor is opened the first time this.autosave(); }