aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-06 22:27:33 -0400
committercash <cash.costello@gmail.com>2011-10-06 22:27:33 -0400
commit28da2f9dcb560687d4904e7629ad38049ed3188a (patch)
treecc91a2192752458884c262cf762753ff4557c086 /js/lib
parent41256f644b02bf4dcb2bc3798bdf470fa93515da (diff)
downloadelgg-28da2f9dcb560687d4904e7629ad38049ed3188a.tar.gz
elgg-28da2f9dcb560687d4904e7629ad38049ed3188a.tar.bz2
using html extension to jquery.ui autocomplete
Diffstat (limited to 'js/lib')
-rw-r--r--js/lib/autocomplete.js31
1 files changed, 3 insertions, 28 deletions
diff --git a/js/lib/autocomplete.js b/js/lib/autocomplete.js
index 917326d4f..46d72d146 100644
--- a/js/lib/autocomplete.js
+++ b/js/lib/autocomplete.js
@@ -5,35 +5,10 @@ elgg.provide('elgg.autocomplete');
elgg.autocomplete.init = function() {
$('.elgg-input-autocomplete').autocomplete({
- source: elgg.autocomplete.url, //gets set by input/autocomplete
- minLength: 1,
- select: function(event, ui) {
- var item = ui.item;
- $(this).val(item.name);
-
- var hidden = $(this).next();
- hidden.val(item.guid);
- }
+ source: elgg.autocomplete.url, //gets set by input/autocomplete view
+ minLength: 2,
+ html: "html"
})
-
- //@todo This seems convoluted
- .data("autocomplete")._renderItem = function(ul, item) {
- switch (item.type) {
- case 'user':
- case 'group':
- r = item.icon + item.name + ' - ' + item.desc;
- break;
-
- default:
- r = item.name + ' - ' + item.desc;
- break;
- }
-
- return $("<li/>")
- .data("item.autocomplete", item)
- .append(r)
- .appendTo(ul);
- };
};
elgg.register_hook_handler('init', 'system', elgg.autocomplete.init); \ No newline at end of file