Login on pressing enter in input boxes
authorDarren <darren@darrenwhitlen.com>
Sun, 28 Aug 2011 17:12:35 +0000 (18:12 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 28 Aug 2011 17:12:35 +0000 (18:12 +0100)
node/client/index.html.jade

index e9437911dfb655f20800ba56690196d36da36a9f..790c44314c99d4bca6f1eaaf9d1c1d32a670911f 100644 (file)
@@ -58,6 +58,13 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
             function addEvents(){
                 $('.more_link').click(function(){ $('.content.bottom').slideDown('fast'); $('.network').focus(); return false; });
                 $('a.connect').click(function(){ $('.formconnectwindow').submit(); return false; });
+
+                var input_submit = function(e){
+                    if (e.which === 13) $('.formconnectwindow').submit();
+                }
+                $('.formconnectwindow .nick').keydown(input_submit);
+                $('.formconnectwindow .channel').keydown(input_submit);
+                $('.formconnectwindow .server').keydown(input_submit);
             }