Sha256: c449091e9222cde7528bd4d712baa92512ff46e4a68f38b4d68b9873bd2067d8

Contents?: true

Size: 844 Bytes

Versions: 9

Compression:

Stored size: 844 Bytes

Contents

(function($) {
    "use strict";

    $.widget('ui.combobox', {
	_create: function() {
	    var input = this.element;
            input.autocomplete({
		delay: 0,
		minLength: 0,
		source: this.options.source
	    }).click(function() {
		if (input.autocomplete('widget').is(':visible')) {
		    input.autocomplete('close');
		} else {
		    input.autocomplete('search', this.value);
		}
	    });
	    $('<button class="ui-combo-button"/>')
		.attr('tabIndex', -1)
		.insertAfter(input)
		.click(function(event) {
		    event.preventDefault();
		    // close if already visible
		    if (input.autocomplete('widget').is(':visible')) {
			input.autocomplete('close');
		    } else {
			// pass empty string as value to search for, displaying all results
			input.autocomplete('search', '');
			input.focus();
		    }
		});
	}
    });
})(jQuery);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
olelo-0.9.15 static/script/17-olelo.ui.combobox.js
olelo-0.9.14 static/script/17-olelo.ui.combobox.js
olelo-0.9.13 static/script/17-olelo.ui.combobox.js
olelo-0.9.12 static/script/17-olelo.ui.combobox.js
olelo-0.9.11 static/script/17-olelo.ui.combobox.js
olelo-0.9.10 static/script/17-olelo.ui.combobox.js
olelo-0.9.9 static/script/17-olelo.ui.combobox.js
olelo-0.9.8 static/script/17-olelo.ui.combobox.js
olelo-0.9.7 static/script/17-olelo.ui.combobox.js