X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3d2eba570bc4586884cc112b1920a4273b4d11c1..0a956f5ab638ecce28608fd8f48bd7c9f761ba63:/forum/skins/default/templates/answer_edit.html diff --git a/forum/skins/default/templates/answer_edit.html b/forum/skins/default/templates/answer_edit.html index d7423af..c9d8466 100644 --- a/forum/skins/default/templates/answer_edit.html +++ b/forum/skins/default/templates/answer_edit.html @@ -35,30 +35,25 @@ }); - function submitClicked(e) { - if(!is_chrome) { + function submitClicked(e, f) { + if(!(browserTester('chrome') || browserTester('safari'))) { $("input.submit")[0].disabled=true; $("input.submit")[1].disabled=true; } window.removeEventListener('beforeunload', beforeUnload, true); + if (f) { + f.submit(); + } } function beforeUnload(e) { - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if($("textarea#editor")[0].value != answer) { - if(is_chrome) { - return "You sure you want to leave? Your work will be lost."; - } else { - yourWorkWillBeLost(e); - } - return false; + return yourWorkWillBeLost(e); } } window.addEventListener('beforeunload', beforeUnload, true); - var answer = ""; - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; {% endblock %} @@ -80,6 +75,7 @@