17 lines
374 B
JavaScript
17 lines
374 B
JavaScript
var search = _.debounce(function(url,query,process){
|
|
$.get(site_url+url,{term: query},function(data) {
|
|
users = {};
|
|
userLabels = [];
|
|
|
|
_.each(data,function(item,ix,list) {
|
|
if (_.contains(users,item.label))
|
|
item.label = item.label + ' #' + item.value;
|
|
|
|
userLabels.push(item.label);
|
|
users[item.label] = item.value;
|
|
});
|
|
|
|
process(userLabels);
|
|
})
|
|
}, 300);
|