mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Autocomplete: Added position option. Fixes #5153 - Autocomplete position option.
This commit is contained in:
parent
5435c50765
commit
612838a151
@ -6,7 +6,12 @@ var autocomplete_defaults = {
|
||||
delay: 300,
|
||||
disabled: false,
|
||||
minLength: 1,
|
||||
source: undefined
|
||||
position: {
|
||||
my: "left top",
|
||||
at: "left bottom",
|
||||
collision: "none"
|
||||
},
|
||||
source: null
|
||||
};
|
||||
|
||||
commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
|
||||
|
17
ui/jquery.ui.autocomplete.js
vendored
17
ui/jquery.ui.autocomplete.js
vendored
@ -16,8 +16,14 @@
|
||||
|
||||
$.widget( "ui.autocomplete", {
|
||||
options: {
|
||||
delay: 300,
|
||||
minLength: 1,
|
||||
delay: 300
|
||||
position: {
|
||||
my: "left top",
|
||||
at: "left bottom",
|
||||
collision: "none"
|
||||
},
|
||||
source: null
|
||||
},
|
||||
_create: function() {
|
||||
var self = this,
|
||||
@ -269,12 +275,9 @@ $.widget( "ui.autocomplete", {
|
||||
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
|
||||
this.menu.deactivate();
|
||||
this.menu.refresh();
|
||||
this.menu.element.show().position({
|
||||
my: "left top",
|
||||
at: "left bottom",
|
||||
of: this.element,
|
||||
collision: "none"
|
||||
});
|
||||
this.menu.element.show().position( $.extend({
|
||||
of: this.element
|
||||
}, this.options.position ));
|
||||
|
||||
menuWidth = ul.width( "" ).outerWidth();
|
||||
textWidth = this.element.outerWidth();
|
||||
|
Loading…
Reference in New Issue
Block a user