X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3d2eba570bc4586884cc112b1920a4273b4d11c1..8c29337f201187a1d8aa0110c9faf36b5d4f9219:/forum/skins/default/templates/question_edit.html diff --git a/forum/skins/default/templates/question_edit.html b/forum/skins/default/templates/question_edit.html index 1d3246c..f0c9e4d 100644 --- a/forum/skins/default/templates/question_edit.html +++ b/forum/skins/default/templates/question_edit.html @@ -41,11 +41,11 @@ return row.n; }*/ formatItem: function(row, i, max, value) { - return row[1].split(".")[0] + " (" + row[1].split(".")[1] + ")"; + return row[1] + " (" + row[2] + ")"; }, formatResult: function(row, i, max, value){ - return row[0]; + return row[1]; } }); @@ -61,24 +61,20 @@ tag = $("input#id_tags")[0].value; }); - 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($("input#id_title")[0].value != title || $("textarea#editor")[0].value != body || $("input#id_tags")[0].value != tag) { - 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); @@ -87,7 +83,6 @@ var title = ""; var body = ""; var tag = ""; - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; {% endblock %} @@ -121,6 +116,7 @@