Improvements to payment and other misc items

This commit is contained in:
Deon George
2013-06-19 19:26:07 +10:00
parent 1caeed6606
commit 3499776ddc
33 changed files with 569 additions and 530 deletions

View File

@@ -0,0 +1,16 @@
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);

View File

@@ -2,7 +2,7 @@ $(document).ready(function() {
$("input[name=search-query]").typeahead({
minLength: 2,
source: function (query,process) {
search (query,process);
search('u/search/ajaxlist',query,process);
},
matcher: function () { return true; },
@@ -12,21 +12,3 @@ $(document).ready(function() {
},
});
});
var search = _.debounce(function( query, process ){
$.get(site_url+"/u/search/ajaxlist", {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);