ec1a70ba108eae9a7dd48d9dba7fe8534384d14e greg Thu Jan 5 13:48:23 2012 -0800 Fixed Issue #5784, where pressing return was not adding a hub like user expected, but submitting the whole form and taken them to hgTracks diff --git src/hg/js/hgHubConnect.js src/hg/js/hgHubConnect.js index 7e6dccd..84b047b 100644 --- src/hg/js/hgHubConnect.js +++ src/hg/js/hgHubConnect.js @@ -2,16 +2,28 @@ $(function(){ $(".hubList tr").hover( 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 + 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 + } + }) +}); + + +