reposition the dropdown whenever results are changed. this is in preparation for open-on-top issue #197
This commit is contained in:
parent
12d2604ff2
commit
0538bdcfa6
13
select2.js
13
select2.js
@ -726,14 +726,15 @@
|
|||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
positionDropdown: function() {
|
positionDropdown: function() {
|
||||||
var offset = this.container.offset();
|
var offset = this.container.offset(),
|
||||||
var height = this.container.outerHeight();
|
height = this.container.outerHeight(),
|
||||||
var width = this.container.outerWidth();
|
width = this.container.outerWidth(),
|
||||||
var css = {
|
css = {
|
||||||
top: offset.top + height,
|
top: offset.top + height,
|
||||||
left: offset.left,
|
left: offset.left,
|
||||||
width: width
|
width: width
|
||||||
}
|
};
|
||||||
|
|
||||||
this.dropdown.css(css);
|
this.dropdown.css(css);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -915,6 +916,7 @@
|
|||||||
} else {
|
} else {
|
||||||
more.remove();
|
more.remove();
|
||||||
}
|
}
|
||||||
|
self.positionDropdown();
|
||||||
self.resultsPage = page;
|
self.resultsPage = page;
|
||||||
})});
|
})});
|
||||||
}
|
}
|
||||||
@ -937,6 +939,7 @@
|
|||||||
function postRender() {
|
function postRender() {
|
||||||
results.scrollTop(0);
|
results.scrollTop(0);
|
||||||
search.removeClass("select2-active");
|
search.removeClass("select2-active");
|
||||||
|
self.positionDropdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
function render(html) {
|
function render(html) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user