1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Order OSD elements in alphabetical order

This commit is contained in:
Miguel Angel Mulero Martinez 2019-06-11 10:56:29 +02:00
parent 5694ac62a8
commit db6651e560

View file

@ -2275,7 +2275,19 @@ TABS.osd.initialize = function (callback) {
}))
);
}
$displayFields.append($field);
// Insert in alphabetical order
let added = false;
$displayFields.children().each(function() {
if ($(this).text() > $field.text()) {
$(this).before($field);
added = true;
return false;
}
});
if(!added) {
$displayFields.append($field);
}
}
GUI.switchery();