Skip to content

Commit

Permalink
Rename custom autocomplete module to avoid interference with original…
Browse files Browse the repository at this point in the history
… jquery autocomplete, use original version to display datalists
  • Loading branch information
guerler committed Jan 11, 2017
1 parent dadd6ee commit bc51f6f
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 35 deletions.
14 changes: 7 additions & 7 deletions client/galaxy/scripts/libs/jquery/jquery.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @param {object|string} options
* @returns (object} jQuery object
*/
$.fn.autocomplete = function(options) {
$.fn.autocomplete_verheul = function(options) {
var url;
if (arguments.length > 1) {
url = options;
Expand All @@ -24,7 +24,7 @@
url = options;
options = { url: url };
}
var opts = $.extend({}, $.fn.autocomplete.defaults, options);
var opts = $.extend({}, $.fn.autocomplete_verheul.defaults, options);
return this.each(function() {
var $this = $(this);
$this.data('autocompleter', new $.Autocompleter(
Expand All @@ -38,7 +38,7 @@
* Store default options
* @type {object}
*/
$.fn.autocomplete.defaults = {
$.fn.autocomplete_verheul.defaults = {
inputClass: 'acInput',
loadingClass: 'acLoading',
resultsClass: 'acResults',
Expand Down Expand Up @@ -289,10 +289,10 @@
/**
* Sanitize options
*/
this.options.minChars = sanitizeInteger(this.options.minChars, $.fn.autocomplete.defaults.minChars, { min: 0 });
this.options.maxItemsToShow = sanitizeInteger(this.options.maxItemsToShow, $.fn.autocomplete.defaults.maxItemsToShow, { min: 0 });
this.options.maxCacheLength = sanitizeInteger(this.options.maxCacheLength, $.fn.autocomplete.defaults.maxCacheLength, { min: 1 });
this.options.delay = sanitizeInteger(this.options.delay, $.fn.autocomplete.defaults.delay, { min: 0 });
this.options.minChars = sanitizeInteger(this.options.minChars, $.fn.autocomplete_verheul.defaults.minChars, { min: 0 });
this.options.maxItemsToShow = sanitizeInteger(this.options.maxItemsToShow, $.fn.autocomplete_verheul.defaults.maxItemsToShow, { min: 0 });
this.options.maxCacheLength = sanitizeInteger(this.options.maxCacheLength, $.fn.autocomplete_verheul.defaults.maxCacheLength, { min: 1 });
this.options.delay = sanitizeInteger(this.options.delay, $.fn.autocomplete_verheul.defaults.delay, { min: 0 });
if (this.options.preventDefaultReturn != 2) {
this.options.preventDefaultReturn = this.options.preventDefaultReturn ? 1 : 0;
}
Expand Down
3 changes: 2 additions & 1 deletion client/galaxy/scripts/mvc/ui/ui-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ define(['utils/utils',
.attr( 'type', this.model.get( 'type' ) )
.attr( 'placeholder', this.model.get( 'placeholder' ) )
.css( 'color', this.model.get( 'color' ) || '' )
.css( 'border-color', this.model.get( 'color' ) || '' );
.css( 'border-color', this.model.get( 'color' ) || '' )
.autocomplete( { source : this.model.get( 'datalist' ) } );
if ( this.model.get( 'value' ) !== this.$el.val() ) {
this.$el.val( this.model.get( 'value' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/ui/autocom_tagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jQuery.fn.autocomplete_tagging = function(options) {
};
var autocomplete_options = { selectFirst: false, formatItem: format_item_func,
autoFill: false, highlight: false };
tag_input_field.autocomplete(settings.ajax_autocomplete_tag_url, autocomplete_options);
tag_input_field.autocomplete_verheul(settings.ajax_autocomplete_tag_url, autocomplete_options);


// Initialize delete tag images for current tags.
Expand Down
2 changes: 1 addition & 1 deletion static/maps/libs/jquery/jquery.autocomplete.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/maps/mvc/ui/ui-misc.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc51f6f

Please sign in to comment.