Guest User

Untitled

a guest
Jun 18th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. $('.searchable').multiSelect({
  2. selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='try \"12\"'>",
  3. selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='try \"4\"'>",
  4. afterInit: function(ms){
  5. var that = this,
  6. $selectableSearch = that.$selectableUl.prev(),
  7. $selectionSearch = that.$selectionUl.prev(),
  8. selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)',
  9. selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';
  10.  
  11. that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
  12. .on('keydown', function(e){
  13. if (e.which === 40){
  14. that.$selectableUl.focus();
  15. return false;
  16. }
  17. });
  18.  
  19. that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
  20. .on('keydown', function(e){
  21. if (e.which == 40){
  22. that.$selectionUl.focus();
  23. return false;
  24. }
  25. });
  26. },
  27. afterSelect: function(){
  28. this.qs1.cache();
  29. this.qs2.cache();
  30. },
  31. afterDeselect: function(){
  32. this.qs1.cache();
  33. this.qs2.cache();
  34. }
  35. });
Advertisement
Add Comment
Please, Sign In to add comment