a15e3582c55c889fc54e8558ca07c2ad1ac76eae larrym Thu Jan 26 11:11:40 2012 -0800 make return key compatible with url checking (#6505) diff --git src/hg/js/hgHubConnect.js src/hg/js/hgHubConnect.js index 84b047b..4b55f7d 100644 --- src/hg/js/hgHubConnect.js +++ src/hg/js/hgHubConnect.js @@ -4,26 +4,27 @@ function(){ $(this).addClass("hoverRow");}, function(){ $(this).removeClass("hoverRow"); } ) }); // initializes the tabs - with cookie option // cookie option requires jquery.cookie.js $(function() { $( "#tabs" ).tabs({ cookie: { name: 'hubTab_cookie', expires: 30 } }); }); // creates keyup event; listening for return key press $(document).ready(function() { - $('#hubUrl').bind('keyup',function(e) { // binds listener to url field + $('#hubUrl').bind('keypress', function(e) { // binds listener to url field if (e.which == 13) { // listens for return key - $('input[name="hubAddButton"]').focus().click(); // clicks the AddHub button e.preventDefault(); // prevents return from also submitting whole form + if(validateUrl($('#hubUrl').val())) + $('input[name="hubAddButton"]').focus().click(); // clicks the AddHub button } }) });