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