Skip to content
Snippets Groups Projects
Commit cb2dd975 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Trigger autocomplete wo button.

parent fa165498
No related branches found
No related tags found
No related merge requests found
......@@ -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] == ',') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment