Prevent code duplication when changing from implement view

This commit is contained in:
Sebastian Serth
2020-11-09 00:01:44 +01:00
parent 902e1e46da
commit e958b890cf

View File

@ -833,8 +833,7 @@ var CodeOceanEditor = {
this.initializeDeadlines(); this.initializeDeadlines();
CodeOceanEditorTips.initializeEventHandlers(); CodeOceanEditorTips.initializeEventHandlers();
window.addEventListener("beforeunload", this.unloadAutoSave.bind(this)); window.addEventListener("turbolinks:request-start", this.unloadAutoSave.bind(this));
window.addEventListener("page:before-change", 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();
} }