diff options
author | Joris Steyn <jorissteyn@gmail.com> | 2014-01-11 12:03:01 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-01-11 12:04:33 +0100 |
commit | 72e4d5417836faa3bc23e21d1054bc6c298bf4ae (patch) | |
tree | d4105bd38dcd79135a1320abd2cbcc6f2e6d7c06 /web | |
parent | 0d68494de76b76861c47df9c56a66d5f07e6c08d (diff) | |
download | aurweb-72e4d5417836faa3bc23e21d1054bc6c298bf4ae.tar.xz |
Typeahead workaround for having to press enter twice
Currently, one has to press enter twice in order to submit the package
search form with typeahead completion. Add a workaround to fix this.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web')
-rw-r--r-- | web/html/home.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/web/html/home.php b/web/html/home.php index e80efaa..62c246a 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -124,6 +124,15 @@ $(document).ready(function() { return item; } }).attr('autocomplete', 'off'); + + $('#pkgsearch-field').keydown(function(e) { + if (e.keyCode == 13) { + var selectedItem = $('ul.pkgsearch-typeahead li.active'); + if (selectedItem.length == 0) { + $('#pkgsearch-form').submit(); + } + } + }); }); </script> <?php |