position the dropdown after hiding selected elements so when above it doesnt float away from the control
This commit is contained in:
parent
39aa17a790
commit
de0d11a82b
@ -741,8 +741,8 @@
|
|||||||
above,
|
above,
|
||||||
css;
|
css;
|
||||||
|
|
||||||
//console.log("droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
|
// console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
|
||||||
//console.log("offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body().scrollTop(), "enough?", enoughRoomAbove);
|
// console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body().scrollTop(), "enough?", enoughRoomAbove);
|
||||||
|
|
||||||
// always prefer the current above/below alignment, unless there is not enough room
|
// always prefer the current above/below alignment, unless there is not enough room
|
||||||
|
|
||||||
@ -1040,7 +1040,6 @@
|
|||||||
|
|
||||||
results.empty();
|
results.empty();
|
||||||
self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
|
self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
|
||||||
postRender();
|
|
||||||
|
|
||||||
if (data.more === true) {
|
if (data.more === true) {
|
||||||
results.children().filter(":last").append("<li class='select2-more-results'>" + opts.formatLoadMore(this.resultsPage) + "</li>");
|
results.children().filter(":last").append("<li class='select2-more-results'>" + opts.formatLoadMore(this.resultsPage) + "</li>");
|
||||||
@ -1048,6 +1047,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.postprocessResults(data, initial);
|
this.postprocessResults(data, initial);
|
||||||
|
|
||||||
|
postRender();
|
||||||
})});
|
})});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user