Allow passing autocomplete type to contact_autocomplete
This commit is contained in:
parent
9f8ce331f3
commit
c9b15bbab5
@ -91,13 +91,15 @@ function basic_replace(item) {
|
|||||||
})( jQuery );
|
})( jQuery );
|
||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
$.fn.contact_autocomplete = function(backend_url, onselect) {
|
$.fn.contact_autocomplete = function(backend_url, typ, onselect) {
|
||||||
|
|
||||||
|
if(typeof typ === 'undefined') typ = '';
|
||||||
|
|
||||||
// Autocomplete contacts
|
// Autocomplete contacts
|
||||||
contacts = {
|
contacts = {
|
||||||
match: /(^)([^\n]+)$/,
|
match: /(^)([^\n]+)$/,
|
||||||
index: 2,
|
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,
|
replace: basic_replace,
|
||||||
template: contact_format,
|
template: contact_format,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#recip").contact_autocomplete(baseurl + '/acl', function(data) {
|
$("#recip").contact_autocomplete(baseurl + '/acl', '', function(data) {
|
||||||
$("#recip-complete").val(data.xid);
|
$("#recip-complete").val(data.xid);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#poke-recip").contact_autocomplete(baseurl + '/acl', function(data) {
|
$("#poke-recip").contact_autocomplete(baseurl + '/acl', 'a', function(data) {
|
||||||
$("#poke-recip-complete").val(data.id);
|
$("#poke-recip-complete").val(data.id);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user