diff options
author | Louis Cuny <louiscuny@gmail.com> | 2012-04-16 22:05:57 +0200 |
---|---|---|
committer | Louis Cuny <louiscuny@gmail.com> | 2012-04-16 22:05:57 +0200 |
commit | 3a143cd138634f8df333a743122a50a04e245b02 (patch) | |
tree | 3ee5748c44f523249811a3fab14611a5e59f2435 | |
parent | e38ae47d78609c52ba6475feaca0fc91ff5d604a (diff) | |
download | multi-select-3a143cd138634f8df333a743122a50a04e245b02.zip multi-select-3a143cd138634f8df333a743122a50a04e245b02.tar.gz multi-select-3a143cd138634f8df333a743122a50a04e245b02.tar.bz2 |
keyboard for searchable method
-rw-r--r-- | demos.html | 1 | ||||
-rw-r--r-- | js/application.js | 10 |
2 files changed, 7 insertions, 4 deletions
@@ -237,6 +237,7 @@ </form> </div> <div class='searchable' style='display:none'> + <input type="text" id="search" autocomplete = "off" /> <form id='searchable-form' action='http://localhost:4567/ms' method='post'> <select name='countries[]' multiple='multiple' id='searchable-select'> <option value='fr' selected='selected'>France</option> diff --git a/js/application.js b/js/application.js index c61af77..5fcc5f5 100644 --- a/js/application.js +++ b/js/application.js @@ -13,11 +13,13 @@ } }); - $('#searchable-form').multiSelect({ - selectableHeader : '<input type="text" id="search" autocomplete = "off" />' - }); + $('#searchable-form').multiSelect({}); - $('input#search').quicksearch('#ms-searchable-form .ms-selectable li'); + $('input#search').quicksearch('#ms-searchable-form .ms-selectable li').on('keydown', function(e){ + if (e.keyCode == 40){ + $('#searchable-select').focus(); + } + }); $('#searchable-form').multiSelect(); |