added enter key event handler for searching

This commit is contained in:
Mike Young
2019-12-15 22:53:56 -05:00
parent 7aa1eb39be
commit 6767bd87df

View File

@@ -4,4 +4,12 @@ $(document).ready(function(){
console.log(query);
window.location.href = '/search/'+query;
})
$('.nav_search').on('keypress', function (e) {
if(e.which === 13){
$(this).attr("disabled", "disabled");
var query = $('.nav_search').val();
window.location.href = '/search/'+query;
$(this).removeAttr("disabled");
}
});
})