From 7fb60ad1ec0f7187875750538605dd94c64cb373 Mon Sep 17 00:00:00 2001 From: Stefan Lage Date: Thu, 23 May 2013 19:48:18 -0400 Subject: [PATCH] nitdoc: Add a secure when the user reload the page If a the page is reloaded or quit when a comment is being edit, we ask if the customer really want to continue. signed-off by: Stefan Lage --- share/nitdoc/scripts/js-facilities.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/nitdoc/scripts/js-facilities.js b/share/nitdoc/scripts/js-facilities.js index 58cbddf..ccbfbb5 100644 --- a/share/nitdoc/scripts/js-facilities.js +++ b/share/nitdoc/scripts/js-facilities.js @@ -53,6 +53,12 @@ var currentTable = null; //Hightlighted index in search result preview table var currentIndex = -1; +// Check if a comment is editing +window.onbeforeunload = function() { + if(editComment > 0){ + return 'Are you sure you want to leave this page?'; + } +}; /* * Add folding and filtering facilities to class description page. -- 1.7.9.5