X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/93c313ff9d33d0efa64f8149fae2b108146dd237..e3641b9e658a4ff9797bf1a523dea032e7450656:/forum/skins/default/media/js/osqa.main.js diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 8f785e3..8fb4d63 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -331,7 +331,8 @@ function process_ajax_response(data, evt, callback) { if (!data.success && data['error_message'] != undefined) { show_message(evt, data.error_message, function() {if (callback) callback(true);}); end_command(false); - } else if (typeof data['commands'] != undefined){ + } + if (typeof data['commands'] != undefined){ for (var command in data.commands) { response_commands[command].apply(null, data.commands[command]) @@ -609,6 +610,14 @@ $(function() { return false; }); + // Submit comment with CTRL + Enter + $textarea.keydown(function(e) { + if (e.ctrlKey && e.keyCode == 13 && !$button.attr('disabled')) { + // console.log('submit'); + $(this).parent().find('input.comment-submit').click(); + } + }); + $cancel.click(function(event) { if (confirm("You will lose all of your changes in this comment. Do you still wish to proceed?")){ if (comment_in_form) {