]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
return in the status textarea will submit the form
authorEvan Prodromou <evan@prodromou.name>
Fri, 5 Sep 2008 04:54:15 +0000 (00:54 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 5 Sep 2008 04:54:15 +0000 (00:54 -0400)
darcs-hash:20080905045415-84dde-bbb6947b53479c2b0f3060094431835784fa686b.gz

js/util.js

index 1e782127d738903ae354075c3d71325e53c721c8..e68a6bab2e4e1a9c71e3be965dcd0ef6390a18aa 100644 (file)
 
 $(document).ready(function(){
         // count character on keyup
-        function counter(){
+        function counter(event){
+             if (event.keyCode == 13) {
+                  $("#status_form").submit();
+             }
+             
             var maxLength     = 140;
             var currentLength = $("#status_textarea").val().length;
             var remaining = maxLength - currentLength;
@@ -32,8 +36,9 @@ $(document).ready(function(){
             }
         }
      
+        $("#status_textarea").bind("keyup", counter);
+     
         if ($("#status_textarea").length) {
-            $("#status_textarea").bind("keyup", counter);
             // run once in case there's something in there
             counter();
         }