mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-02-07 01:54:16 +01:00
Trigger autocomplete wo button.
This commit is contained in:
parent
e44a246e16
commit
cd9d399b89
@ -5,14 +5,25 @@
|
|||||||
(function( $ ) {
|
(function( $ ) {
|
||||||
$.widget('ui.multiple_autocomplete', {
|
$.widget('ui.multiple_autocomplete', {
|
||||||
_create: function() {
|
_create: function() {
|
||||||
|
var self = this;
|
||||||
function split( val ) {
|
function split( val ) {
|
||||||
return val.split( /,\s*/ );
|
return val.split( /,\s*/ );
|
||||||
}
|
}
|
||||||
function extractLast( term ) {
|
function extractLast( term ) {
|
||||||
return split( term ).pop();
|
return split( term ).pop();
|
||||||
}
|
}
|
||||||
|
function showOptions() {
|
||||||
|
if(!self.element.autocomplete('widget').is(':visible') && self.element.val().trim() == '') {
|
||||||
|
self.element.autocomplete('search', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
//console.log('_create: ' + this.options['id']);
|
//console.log('_create: ' + this.options['id']);
|
||||||
var self = this;
|
this.element.bind('click', function( event ) {
|
||||||
|
showOptions();
|
||||||
|
});
|
||||||
|
this.element.bind('input', function( event ) {
|
||||||
|
showOptions();
|
||||||
|
});
|
||||||
this.element.bind('blur', function( event ) {
|
this.element.bind('blur', function( event ) {
|
||||||
var tmp = self.element.val().trim();
|
var tmp = self.element.val().trim();
|
||||||
if(tmp[tmp.length-1] == ',') {
|
if(tmp[tmp.length-1] == ',') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user