diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-03-27 12:29:19 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-03-27 12:30:20 +0200 |
commit | cb2dd97509ffd039fbd321aea4a8d631e3effcc7 (patch) | |
tree | d0d2e8e5d490a22306e618689ee2516ba3787700 | |
parent | fa165498ccfe2becbdaf997b4e36336e794cce50 (diff) | |
download | nextcloud-server-cb2dd97509ffd039fbd321aea4a8d631e3effcc7.tar.gz nextcloud-server-cb2dd97509ffd039fbd321aea4a8d631e3effcc7.zip |
Trigger autocomplete wo button.
-rw-r--r-- | apps/contacts/js/jquery.multi-autocomplete.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/contacts/js/jquery.multi-autocomplete.js b/apps/contacts/js/jquery.multi-autocomplete.js index 1c923a2543d..7607de3f918 100644 --- a/apps/contacts/js/jquery.multi-autocomplete.js +++ b/apps/contacts/js/jquery.multi-autocomplete.js @@ -5,14 +5,25 @@ (function( $ ) { $.widget('ui.multiple_autocomplete', { _create: function() { + var self = this; function split( val ) { return val.split( /,\s*/ ); } function extractLast( term ) { 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']); - var self = this; + this.element.bind('click', function( event ) { + showOptions(); + }); + this.element.bind('input', function( event ) { + showOptions(); + }); this.element.bind('blur', function( event ) { var tmp = self.element.val().trim(); if(tmp[tmp.length-1] == ',') { |