fire a warning before closing an unsaved file

This commit is contained in:
ilvalle
2013-06-12 13:18:48 +02:00
parent 6af173c853
commit 4f15c03686
3 changed files with 18 additions and 8 deletions
@@ -113,6 +113,11 @@
CodeMirror.showHint(cm, CodeMirror.pythonHint);
}
{{pass}}
store_changes_function = function(instance, changeObj) {
jQuery(instance).data('saved', false);
instance.off("change", store_changes_function);
}
editor.on("change", store_changes_function);
// save the editor as textarea data attribute
jQuery("#{{=id}} textarea").data('editor', editor);
var hlLine = editor.addLineClass(0, "background", "activeline");