Alert when changes may not been saved

This commit is contained in:
Jeremy Zhang 2018-07-23 02:43:46 +00:00
parent 150e112387
commit 1e80512ca7

View File

@ -1,5 +1,11 @@
/*global $, ace, Materialize, newCSS, CSS_ID, ADMIN*/ /*global $, ace, Materialize, newCSS, CSS_ID, ADMIN*/
(function () { (function () {
$(window).bind('beforeunload', function(){
if ($("#live_preview_warning").is(":visible")) {
return true;
}
});
if($("#css_editor").length != 0) { if($("#css_editor").length != 0) {
var editor = ace.edit("css_editor"); var editor = ace.edit("css_editor");
} }