mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 13:09:33 -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",
|
||||
"isDisabled",
|
||||
"isHidden",
|
||||
"isAbove",
|
||||
"isBelow",
|
||||
"isLeftAligned",
|
||||
"isRightAligned",
|
||||
"hasSelection",
|
||||
"hasReachedMaximum",
|
||||
"hasReachedMinimum"
|
||||
|
@ -69,8 +69,10 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
_adjustPosition() {
|
||||
if (this.get("isExpanded")) {
|
||||
this._applyDirection();
|
||||
}
|
||||
this._applyFixedPosition();
|
||||
this._applyDirection();
|
||||
this._positionWrapper();
|
||||
},
|
||||
|
||||
@ -197,11 +199,15 @@ export default Ember.Mixin.create({
|
||||
parentWidth - marginToEdge - bodyWidth + this.get("horizontalOffset") >
|
||||
0;
|
||||
if (enoughMarginToOppositeEdge) {
|
||||
this.setProperties({ isLeftAligned: true, isRightAligned: false });
|
||||
this.$()
|
||||
.addClass("is-left-aligned")
|
||||
.removeClass("is-right-aligned");
|
||||
options.left = this.get("horizontalOffset");
|
||||
options.right = "unset";
|
||||
} else {
|
||||
this.setProperties({ isLeftAligned: false, isRightAligned: true });
|
||||
this.$()
|
||||
.addClass("is-right-aligned")
|
||||
.removeClass("is-left-aligned");
|
||||
options.left = "unset";
|
||||
options.right = this.get("horizontalOffset");
|
||||
}
|
||||
@ -214,10 +220,14 @@ export default Ember.Mixin.create({
|
||||
const headerHeight = this._computedStyle(this.$header()[0], "height");
|
||||
|
||||
if (hasBelowSpace || (!hasBelowSpace && !hasAboveSpace)) {
|
||||
this.setProperties({ isBelow: true, isAbove: false });
|
||||
this.$()
|
||||
.addClass("is-below")
|
||||
.removeClass("is-above");
|
||||
options.top = headerHeight + this.get("verticalOffset");
|
||||
} else {
|
||||
this.setProperties({ isBelow: false, isAbove: true });
|
||||
this.$()
|
||||
.addClass("is-above")
|
||||
.removeClass("is-below");
|
||||
options.bottom = headerHeight + this.get("verticalOffset");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user