PERF: reduces cpu/memory consumption of sk in some cases (#7525)

This commit is contained in:
Joffrey JAFFEUX 2019-05-10 17:12:10 +02:00 committed by GitHub
parent 01bd82139f
commit c093fa0376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 10 deletions

View File

@ -25,7 +25,7 @@ export default SingleSelectComponent.extend({
return isExpanded ? caretUpIcon : caretDownIcon;
},
@on("didReceiveAttrs")
@on("didUpdateAttrs", "init")
_setComboBoxOptions() {
this.get("headerComponentOptions").setProperties({
clearable: this.get("clearable")

View File

@ -13,7 +13,7 @@ export default SingleSelectComponent.extend({
showFullTitle: true,
allowInitialValueMutation: false,
@on("didReceiveAttrs")
@on("didUpdateAttrs", "init")
_setDropdownSelectBoxComponentOptions() {
this.get("headerComponentOptions").setProperties({
showFullTitle: this.get("showFullTitle")

View File

@ -44,7 +44,7 @@ export default SelectKitComponent.extend({
}
},
@on("didReceiveAttrs")
@on("didUpdateAttrs", "init")
_compute() {
run.scheduleOnce("afterRender", () => {
this.willComputeAttributes();

View File

@ -14,7 +14,7 @@ export default DropdownSelectBoxComponent.extend({
return isExpanded ? "caret-up" : "caret-down";
},
@on("didReceiveAttrs")
@on("didUpdateAttrs", "init")
_setFullDay() {
this.get("headerComponentOptions").setProperties({
fullDay: this.get("fullDay")

View File

@ -52,11 +52,10 @@ export default Ember.Component.extend(UtilsMixin, {
@on("didReceiveAttrs")
_setSelectionState() {
this.set("isSelected", this.get("computedValue") === this.get("value"));
this.set(
"isHighlighted",
this.get("highlighted.value") === this.get("value")
);
this.setProperties({
isSelected: this.get("computedValue") === this.get("value"),
isHighlighted: this.get("highlighted.value") === this.get("value")
});
},
@on("willDestroyElement")

View File

@ -18,7 +18,7 @@ export default SelectKitComponent.extend({
value: null,
allowInitialValueMutation: false,
@on("didReceiveAttrs")
@on("didUpdateAttrs", "init")
_compute() {
run.scheduleOnce("afterRender", () => {
this.willComputeAttributes();