added warning on tab close/reload

This commit is contained in:
Max Robinson
2021-12-02 17:56:39 -06:00
parent b4ca97902b
commit 754703a935

View File

@@ -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() {