diff --git a/static/models.js b/static/models.js index 70a53b09b..71a02c400 100644 --- a/static/models.js +++ b/static/models.js @@ -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); } });