mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
added enter key event handler for searching
This commit is contained in:
8
src/interface/static/js/pyshelf_ux.js
vendored
8
src/interface/static/js/pyshelf_ux.js
vendored
@@ -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");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user