Fix autocomplete and typeahead options extending

This commit is contained in:
Illimar Tambek
2014-03-06 13:08:03 +02:00
parent 7de42b19cf
commit bf62624bc7
3 changed files with 11 additions and 7 deletions

View File

@@ -155,16 +155,18 @@
// Initialize autocomplete, if necessary
if ( ! $.isEmptyObject( this.options.autocomplete ) ) {
var side = this.textDirection === 'rtl' ? 'right' : 'left'
var autocompleteOptions = $.extend({}, this.options.autocomplete, {
var autocompleteOptions = $.extend({
minLength: this.options.showAutocompleteOnFocus ? 0 : null,
position: { my: side + " top", at: side + " bottom", of: this.$wrapper }
})
}, this.options.autocomplete )
this.$input.autocomplete( autocompleteOptions )
}
// Initialize typeahead, if necessary
if ( ! $.isEmptyObject( this.options.typeahead ) ) {
var typeaheadOptions = $.extend({}, this.options.typeahead, {})
var typeaheadOptions = $.extend({
minLength: this.options.showAutocompleteOnFocus ? 0 : null
}, this.options.typeahead)
this.$input.typeahead( null, typeaheadOptions )
this.typeahead = true
}

File diff suppressed because one or more lines are too long

View File

@@ -155,16 +155,18 @@
// Initialize autocomplete, if necessary
if ( ! $.isEmptyObject( this.options.autocomplete ) ) {
var side = this.textDirection === 'rtl' ? 'right' : 'left'
var autocompleteOptions = $.extend({}, this.options.autocomplete, {
var autocompleteOptions = $.extend({
minLength: this.options.showAutocompleteOnFocus ? 0 : null,
position: { my: side + " top", at: side + " bottom", of: this.$wrapper }
})
}, this.options.autocomplete )
this.$input.autocomplete( autocompleteOptions )
}
// Initialize typeahead, if necessary
if ( ! $.isEmptyObject( this.options.typeahead ) ) {
var typeaheadOptions = $.extend({}, this.options.typeahead, {})
var typeaheadOptions = $.extend({
minLength: this.options.showAutocompleteOnFocus ? 0 : null
}, this.options.typeahead)
this.$input.typeahead( null, typeaheadOptions )
this.typeahead = true
}