diff --git a/src/Controllers/ControlPanel.js b/src/Controllers/ControlPanel.js index b2dd295..a6e633b 100644 --- a/src/Controllers/ControlPanel.js +++ b/src/Controllers/ControlPanel.js @@ -336,7 +336,16 @@ class ControlPanel { $('#clear-editor').click( function() { this.engine.organism_editor.clear(); this.editor_controller.setEditorPanel(); - }.bind(this)); + }.bind(this)) + + window.onbeforeunload = function (e) { + e = e || window.event; + let return_str = 'this will cause a confirmation on page close' + if (e) { + e.returnValue = return_str; + } + return return_str; + }; } defineChallenges() {