Sort the compiler groups alphabetically

This commit is contained in:
Matt Godbolt
2018-06-08 16:41:57 -05:00
parent 3d885ebdaf
commit cbcdc75bc4

View File

@@ -120,6 +120,7 @@ function Compiler(hub, container, state) {
searchField: ['name'],
optgroupField: 'group',
optgroups: this.getGroupsInUse(),
lockOptgroupOrder: true,
options: _.map(this.getCurrentLangCompilers(), _.identity),
items: this.compiler ? [this.compiler.id] : []
}).on('change', _.bind(function (e) {
@@ -156,11 +157,11 @@ Compiler.prototype.clearEditorsLinkedLines = function () {
Compiler.prototype.getGroupsInUse = function () {
var currentLangCompilers = _.map(this.getCurrentLangCompilers(), _.identity);
return _.map(_.uniq(currentLangCompilers, false, function (compiler) {
return _.sortBy(_.map(_.uniq(currentLangCompilers, false, function (compiler) {
return compiler.group;
}), function (compiler) {
return {value: compiler.group, label: compiler.groupName || compiler.group};
});
}), 'label');
};
Compiler.prototype.close = function () {