]> git.openstreetmap.org Git - osqa.git/commitdiff
be able to submit comment only with Ctrl + Enter
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 31 Aug 2011 12:56:30 +0000 (12:56 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 31 Aug 2011 12:56:30 +0000 (12:56 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1168 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js

index 8f785e30a294593747f900bbf79de0c3c5736413..0c16eeabed6e49166e8ef477d51db2c313947df6 100644 (file)
@@ -609,6 +609,14 @@ $(function() {
                 return false;\r
             });\r
 \r
+            // Submit comment with CTRL + Enter\r
+            $textarea.keydown(function(e) {\r
+                if (e.ctrlKey && e.keyCode == 13 && !$button.attr('disabled')) {\r
+                    // console.log('submit');\r
+                    $(this).parent().find('input.comment-submit').click();\r
+                }\r
+            });\r
+\r
             $cancel.click(function(event) {\r
                 if (confirm("You will lose all of your changes in this comment.  Do you still wish to proceed?")){\r
                     if (comment_in_form) {\r