mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:02:46 +08:00
PERF: reduces cpu/memory consumption of sk in some cases (#7525)
This commit is contained in:
parent
01bd82139f
commit
c093fa0376
|
@ -25,7 +25,7 @@ export default SingleSelectComponent.extend({
|
||||||
return isExpanded ? caretUpIcon : caretDownIcon;
|
return isExpanded ? caretUpIcon : caretDownIcon;
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didUpdateAttrs", "init")
|
||||||
_setComboBoxOptions() {
|
_setComboBoxOptions() {
|
||||||
this.get("headerComponentOptions").setProperties({
|
this.get("headerComponentOptions").setProperties({
|
||||||
clearable: this.get("clearable")
|
clearable: this.get("clearable")
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default SingleSelectComponent.extend({
|
||||||
showFullTitle: true,
|
showFullTitle: true,
|
||||||
allowInitialValueMutation: false,
|
allowInitialValueMutation: false,
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didUpdateAttrs", "init")
|
||||||
_setDropdownSelectBoxComponentOptions() {
|
_setDropdownSelectBoxComponentOptions() {
|
||||||
this.get("headerComponentOptions").setProperties({
|
this.get("headerComponentOptions").setProperties({
|
||||||
showFullTitle: this.get("showFullTitle")
|
showFullTitle: this.get("showFullTitle")
|
||||||
|
|
|
@ -44,7 +44,7 @@ export default SelectKitComponent.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didUpdateAttrs", "init")
|
||||||
_compute() {
|
_compute() {
|
||||||
run.scheduleOnce("afterRender", () => {
|
run.scheduleOnce("afterRender", () => {
|
||||||
this.willComputeAttributes();
|
this.willComputeAttributes();
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
return isExpanded ? "caret-up" : "caret-down";
|
return isExpanded ? "caret-up" : "caret-down";
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didUpdateAttrs", "init")
|
||||||
_setFullDay() {
|
_setFullDay() {
|
||||||
this.get("headerComponentOptions").setProperties({
|
this.get("headerComponentOptions").setProperties({
|
||||||
fullDay: this.get("fullDay")
|
fullDay: this.get("fullDay")
|
||||||
|
|
|
@ -52,11 +52,10 @@ export default Ember.Component.extend(UtilsMixin, {
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didReceiveAttrs")
|
||||||
_setSelectionState() {
|
_setSelectionState() {
|
||||||
this.set("isSelected", this.get("computedValue") === this.get("value"));
|
this.setProperties({
|
||||||
this.set(
|
isSelected: this.get("computedValue") === this.get("value"),
|
||||||
"isHighlighted",
|
isHighlighted: this.get("highlighted.value") === this.get("value")
|
||||||
this.get("highlighted.value") === this.get("value")
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("willDestroyElement")
|
@on("willDestroyElement")
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default SelectKitComponent.extend({
|
||||||
value: null,
|
value: null,
|
||||||
allowInitialValueMutation: false,
|
allowInitialValueMutation: false,
|
||||||
|
|
||||||
@on("didReceiveAttrs")
|
@on("didUpdateAttrs", "init")
|
||||||
_compute() {
|
_compute() {
|
||||||
run.scheduleOnce("afterRender", () => {
|
run.scheduleOnce("afterRender", () => {
|
||||||
this.willComputeAttributes();
|
this.willComputeAttributes();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user