mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 05:25:52 +08:00
FIX: makes more resilient select-kit positioning (#6776)
This commit is contained in:
parent
6213e020e6
commit
d803dfc14a
@ -64,6 +64,10 @@ export default Ember.Mixin.create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
@on("didRender")
|
@on("didRender")
|
||||||
|
_schedulePositionRendering() {
|
||||||
|
Ember.run.debounce(this, this._adjustPosition, 50, true);
|
||||||
|
},
|
||||||
|
|
||||||
_adjustPosition() {
|
_adjustPosition() {
|
||||||
this._applyFixedPosition();
|
this._applyFixedPosition();
|
||||||
this._applyDirection();
|
this._applyDirection();
|
||||||
@ -205,9 +209,10 @@ export default Ember.Mixin.create({
|
|||||||
|
|
||||||
const fullHeight =
|
const fullHeight =
|
||||||
this.get("verticalOffset") + bodyHeight + componentHeight;
|
this.get("verticalOffset") + bodyHeight + componentHeight;
|
||||||
const hasBelowSpace = $(window).height() - offsetBottom - fullHeight > 0;
|
const hasBelowSpace = $(window).height() - offsetBottom - fullHeight >= -1;
|
||||||
const hasAboveSpace = offsetTop - fullHeight - discourseHeaderHeight > 0;
|
const hasAboveSpace = offsetTop - fullHeight - discourseHeaderHeight >= -1;
|
||||||
const headerHeight = this._computedStyle(this.$header()[0], "height");
|
const headerHeight = this._computedStyle(this.$header()[0], "height");
|
||||||
|
|
||||||
if (hasBelowSpace || (!hasBelowSpace && !hasAboveSpace)) {
|
if (hasBelowSpace || (!hasBelowSpace && !hasAboveSpace)) {
|
||||||
this.setProperties({ isBelow: true, isAbove: false });
|
this.setProperties({ isBelow: true, isAbove: false });
|
||||||
options.top = headerHeight + this.get("verticalOffset");
|
options.top = headerHeight + this.get("verticalOffset");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user