Merge pull request #5285 from pratu16x7/modules-select
[desktop-icons] sort icon select options, fixes frappe/erpnext#10236
This commit is contained in:
commit
410db5b4e3
1 changed files with 10 additions and 4 deletions
|
|
@ -61,10 +61,16 @@ frappe.ui.toolbar.ModulesSelect = class {
|
|||
callback: (r) => {
|
||||
const icons = r.message.icons;
|
||||
const user = r.message.user;
|
||||
resolve(icons.map(icon => {
|
||||
const uncheck = user ? icon.hidden : icon.blocked;
|
||||
return { label: icon.value, value: icon.module_name, checked:!uncheck };
|
||||
}));
|
||||
resolve(icons
|
||||
.map(icon => {
|
||||
const uncheck = user ? icon.hidden : icon.blocked;
|
||||
return { label: icon.value, value: icon.module_name, checked:!uncheck };
|
||||
}).sort(function(a, b){
|
||||
if(a.label < b.label) return -1;
|
||||
if(a.label > b.label) return 1;
|
||||
return 0;
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue