mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures nothing is triggering rendering loop in after render (#6784)
This commit is contained in:
parent
01cdbd3a13
commit
6ee3900791
@ -25,10 +25,6 @@ export default Ember.Component.extend(
|
|||||||
"isExpanded",
|
"isExpanded",
|
||||||
"isDisabled",
|
"isDisabled",
|
||||||
"isHidden",
|
"isHidden",
|
||||||
"isAbove",
|
|
||||||
"isBelow",
|
|
||||||
"isLeftAligned",
|
|
||||||
"isRightAligned",
|
|
||||||
"hasSelection",
|
"hasSelection",
|
||||||
"hasReachedMaximum",
|
"hasReachedMaximum",
|
||||||
"hasReachedMinimum"
|
"hasReachedMinimum"
|
||||||
|
@ -69,8 +69,10 @@ export default Ember.Mixin.create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_adjustPosition() {
|
_adjustPosition() {
|
||||||
this._applyFixedPosition();
|
if (this.get("isExpanded")) {
|
||||||
this._applyDirection();
|
this._applyDirection();
|
||||||
|
}
|
||||||
|
this._applyFixedPosition();
|
||||||
this._positionWrapper();
|
this._positionWrapper();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -197,11 +199,15 @@ export default Ember.Mixin.create({
|
|||||||
parentWidth - marginToEdge - bodyWidth + this.get("horizontalOffset") >
|
parentWidth - marginToEdge - bodyWidth + this.get("horizontalOffset") >
|
||||||
0;
|
0;
|
||||||
if (enoughMarginToOppositeEdge) {
|
if (enoughMarginToOppositeEdge) {
|
||||||
this.setProperties({ isLeftAligned: true, isRightAligned: false });
|
this.$()
|
||||||
|
.addClass("is-left-aligned")
|
||||||
|
.removeClass("is-right-aligned");
|
||||||
options.left = this.get("horizontalOffset");
|
options.left = this.get("horizontalOffset");
|
||||||
options.right = "unset";
|
options.right = "unset";
|
||||||
} else {
|
} else {
|
||||||
this.setProperties({ isLeftAligned: false, isRightAligned: true });
|
this.$()
|
||||||
|
.addClass("is-right-aligned")
|
||||||
|
.removeClass("is-left-aligned");
|
||||||
options.left = "unset";
|
options.left = "unset";
|
||||||
options.right = this.get("horizontalOffset");
|
options.right = this.get("horizontalOffset");
|
||||||
}
|
}
|
||||||
@ -214,10 +220,14 @@ export default Ember.Mixin.create({
|
|||||||
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.$()
|
||||||
|
.addClass("is-below")
|
||||||
|
.removeClass("is-above");
|
||||||
options.top = headerHeight + this.get("verticalOffset");
|
options.top = headerHeight + this.get("verticalOffset");
|
||||||
} else {
|
} else {
|
||||||
this.setProperties({ isBelow: false, isAbove: true });
|
this.$()
|
||||||
|
.addClass("is-above")
|
||||||
|
.removeClass("is-below");
|
||||||
options.bottom = headerHeight + this.get("verticalOffset");
|
options.bottom = headerHeight + this.get("verticalOffset");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user