Handle setting with undefined weight
Related-Bug: #1644461 Change-Id: I49fa28eb9aed96ec7aeed01d9d4d65363fe89d88
This commit is contained in:
parent
f85cd7c68a
commit
412f9a29cb
|
@ -953,7 +953,9 @@ models.Settings = BaseModel
|
|||
this.isValid({models});
|
||||
},
|
||||
sortAttributes({weight: weight1, label: label1}, {weight: weight2, label: label2}) {
|
||||
if (weight1 !== weight2) return weight1 - weight2;
|
||||
if (weight1 !== weight2 && (weight1 || weight2)) {
|
||||
return (weight1 && weight2) ? weight1 - weight2 : weight1 ? -1 : 1;
|
||||
}
|
||||
return utils.natsort(label1, label2);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue