Allow passing autocomplete type to contact_autocomplete

This commit is contained in:
Stefan Parviainen
2015-01-07 20:38:56 +01:00
parent 9f8ce331f3
commit c9b15bbab5
3 changed files with 6 additions and 4 deletions

View File

@@ -91,13 +91,15 @@ function basic_replace(item) {
})( jQuery );
(function( $ ){
$.fn.contact_autocomplete = function(backend_url, onselect) {
$.fn.contact_autocomplete = function(backend_url, typ, onselect) {
if(typeof typ === 'undefined') typ = '';
// Autocomplete contacts
contacts = {
match: /(^)([^\n]+)$/,
index: 2,
search: function(term, callback) { contact_search(term, callback, backend_url, '',[]); },
search: function(term, callback) { contact_search(term, callback, backend_url, typ,[]); },
replace: basic_replace,
template: contact_format,
}