From e958b890cfa09e837e0392456ae8cbf7faa4a798 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 9 Nov 2020 00:01:44 +0100 Subject: [PATCH] Prevent code duplication when changing from implement view --- app/assets/javascripts/editor/editor.js.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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(); }