mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-29 08:14:06 +00:00
Added width updation on resize
The width of the autocomplete suggestions box now updates on resize to match the parent width, in addition to the position.
This commit is contained in:
parent
2f260cec63
commit
ec01932c4d
@ -228,7 +228,8 @@
|
|||||||
|
|
||||||
fixPosition: function () {
|
fixPosition: function () {
|
||||||
var that = this,
|
var that = this,
|
||||||
offset;
|
offset,
|
||||||
|
width;
|
||||||
|
|
||||||
// Don't adjsut position if custom container has been specified:
|
// Don't adjsut position if custom container has been specified:
|
||||||
if (that.options.appendTo !== 'body') {
|
if (that.options.appendTo !== 'body') {
|
||||||
@ -236,10 +237,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
offset = that.el.offset();
|
offset = that.el.offset();
|
||||||
|
width = that.el.outerWidth() - 2;
|
||||||
|
|
||||||
$(that.suggestionsContainer).css({
|
$(that.suggestionsContainer).css({
|
||||||
top: (offset.top + that.el.outerHeight()) + 'px',
|
top: (offset.top + that.el.outerHeight()) + 'px',
|
||||||
left: offset.left + 'px'
|
left: offset.left + 'px',
|
||||||
|
width: width + 'px'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user