From acbe1e886071d166cffdbc0ec7dfc2cbba97f5dc Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Fri, 30 Mar 2012 05:49:32 -0700 Subject: [PATCH] Re-enabled unsaved changes confirmation on wiki edit. --- templates/simplewiki_edit.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/simplewiki_edit.html b/templates/simplewiki_edit.html index 87e53869fa..d5bd22cf8a 100644 --- a/templates/simplewiki_edit.html +++ b/templates/simplewiki_edit.html @@ -44,12 +44,12 @@ //Store the inital contents so we can compare for unsaved changes var initial_contents = editor.getValue(); - // window.onbeforeunload = function askConfirm() { //Warn the user before they navigate away - // if ( editor.getValue() != initial_contents ) { - // return "You have made changes to the article that have not been saved yet."; - // } - // }; - + window.onbeforeunload = function askConfirm() { //Warn the user before they navigate away + if ( editor.getValue() != initial_contents ) { + return "You have made changes to the article that have not been saved yet."; + } + }; + $("#submit_edit").click(function() { initial_contents = editor.getValue(); });