mirror of
https://github.com/friendica/friendica
synced 2024-11-19 04:23:41 +00:00
Merge pull request #7595 from friendica/7594-restore-name-autocomplete
Restore contact name autocomplete in private message recipient field
This commit is contained in:
commit
6da1901fca
1 changed files with 25 additions and 0 deletions
|
@ -286,6 +286,31 @@ function string2bb(element) {
|
|||
};
|
||||
})( jQuery );
|
||||
|
||||
(function( $ ) {
|
||||
$.fn.name_autocomplete = function(backend_url, typ, autosubmit, onselect) {
|
||||
if(typeof typ === 'undefined') typ = '';
|
||||
if(typeof autosubmit === 'undefined') autosubmit = false;
|
||||
|
||||
// Autocomplete contacts
|
||||
names = {
|
||||
match: /(^)([^\n]+)$/,
|
||||
index: 2,
|
||||
search: function(term, callback) { contact_search(term, callback, backend_url, typ); },
|
||||
replace: trim_replace,
|
||||
template: contact_format,
|
||||
};
|
||||
|
||||
this.attr('autocomplete','off');
|
||||
var a = this.textcomplete([names], {className:'acpopup', zIndex:10000});
|
||||
|
||||
if(autosubmit)
|
||||
a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
|
||||
|
||||
if(typeof onselect !== 'undefined')
|
||||
a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
|
||||
};
|
||||
})( jQuery );
|
||||
|
||||
(function( $ ) {
|
||||
$.fn.bbco_autocomplete = function(type) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue