fix: new nav items will show group select

v1.18.x
Barış Soner Uşaklı 5 years ago
parent f402d7271a
commit c5f7b66c3a

@ -69,6 +69,7 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'benchpress', 'j
data.index = (parseInt($('#enabled').children().last().attr('data-index'), 10) || 0) + 1;
data.title = translator.escape(data.title);
data.text = translator.escape(data.text);
data.groups = ajaxify.data.groups;
Benchpress.parse('admin/general/navigation', 'navigation', { navigation: [data] }, function (li) {
translator.translate(li, function (li) {
li = $(translator.unescape(li));

@ -13,13 +13,13 @@ navigationController.get = async function (req, res) {
]);
allGroups.sort((a, b) => b.system - a.system);
const groupsData = allGroups.map(group => ({ name: group.name, displayName: group.displayName }));
admin.groups = allGroups.map(group => ({ name: group.name, displayName: group.displayName }));
admin.enabled.forEach(function (enabled, index) {
enabled.index = index;
enabled.selected = index === 0;
enabled.groups = groupsData.map(function (group) {
enabled.groups = admin.groups.map(function (group) {
return {
displayName: group.displayName,
selected: enabled.groups.includes(group.name),

Loading…
Cancel
Save