Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. $('#people').autocomplete({
  2. source: base_url + "tags/jq_get_tags_by_search_as_object/" + $("#bookmark-active").val() + "/3",
  3. appendTo: ".people-results",
  4. messages: {
  5. noResults: function(event, ui) {
  6. $(this).addClass( "automcomple-results" );
  7. $(this).text("I can't find any Tags.");
  8. },
  9. results: function(event, ui) {
  10. $(this).addClass( "automcomple-results" );
  11. $(this).text(event + " Tags found.");
  12. }
  13. },
  14. position: { my : "left top", at: "left bottom", collision: "flipfit" },
  15. open: function(event, ui) {
  16. $('ul.ui-autocomplete#tags-people')
  17. .removeAttr('style')
  18. .hide()
  19. .appendTo('.people-results')
  20. .show();
  21. },
  22. select: function(event, ui) {
  23. $('.people-results')
  24. .append('<div class="bookmark-tag-box" id="bookmark-tag-people-box-' + ui.item.tag_id + '"><input type="checkbox" id="bookmark-tag-people-item-' + ui.item.tag_id + '" name="bookmark-tags-people-add[' + ui.item.tag_id + ']" value="' + ui.item.tag + '" checked="checked">' + ui.item.tag + '</div>');
  25. }
  26. }).data("uiAutocomplete")._renderItem = function(ul, item) {
  27. return $('<li></li>')
  28. .data("item.autocomplete", item)
  29. .append('<a>' + item.tag + '</a>')
  30. .appendTo(ul);
  31. };
  32. });
  33.  
  34. span.ui-helper-hidden-accessible { display: none; }
  35.  
  36. .automcomple-results { background-color: white; border-bottom: 3px solid white; border-left: 5px solid white; border-right: 5px solid white; border-top: 3px solid white; border-radius: 5px; margin: 5px; }
  37.  
  38. $(this).text(event + " Tags found.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement