2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-29 16:24:05 +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:
ashrayjain 2013-07-21 23:11:59 +05:30
parent 2f260cec63
commit ec01932c4d

View File

@ -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'
}); });
}, },