X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/9b59b6bb395208c913ce5ce19212dd5341cfa98a..483162a72bfe820b11db05c384c0fc6103d084cf:/forum/skins/default/templates/question.html diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index efc5f5e..6407978 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -41,24 +41,29 @@ $('#previewer').toggle(); $('#pre-collapse').text(txt); }); - }); + function submitClicked(e) { + if(!(browserTester('chrome') || browserTester('safari'))) { + $("input.submit")[0].disabled=true; + } + window.removeEventListener('beforeunload', beforeUnload, true); + } + function beforeUnload(e) { + if($("textarea#editor")[0].value != "") { - yourWorkWillBeLost(e); + return yourWorkWillBeLost(e); } - $("textarea.commentBox").each(function() { - if(this.value != "") { - yourWorkWillBeLost(e); - } - }); - - return false; + var commentBoxes = $("textarea.commentBox"); + for(var index = 0; index < commentBoxes.length; index++) { + if(commentBoxes[index].value != "") { + return yourWorkWillBeLost(e); + } + } } window.addEventListener('beforeunload', beforeUnload, true); -