Use standard list format for message area select

This commit is contained in:
Bryan Ashby 2018-06-23 11:17:21 -06:00
parent 812fd28d82
commit 4ef1061fc5
1 changed files with 10 additions and 22 deletions

View File

@ -136,31 +136,20 @@ exports.getModule = class MessageAreaListModule extends MenuModule {
});
},
function populateAreaListView(callback) {
const listFormat = self.menuConfig.config.listFormat || '{index} ) - {name}';
const focusListFormat = self.menuConfig.config.focusListFormat || listFormat;
const areaListView = vc.getView(MciViewIds.AreaList);
if(!areaListView) {
return callback(Errors.MissingMci('A MenuView compatible MCI code is required'));
}
let i = 1;
areaListView.setItems(_.map(self.messageAreas, v => {
return stringFormat(listFormat, {
index : i++,
areaTag : v.area.areaTag,
name : v.area.name,
desc : v.area.desc,
});
}));
i = 1;
areaListView.setFocusItems(_.map(self.messageAreas, v => {
return stringFormat(focusListFormat, {
let i = 1;
areaListView.setItems(self.messageAreas.map(a => {
return {
index : i++,
areaTag : v.area.areaTag,
name : v.area.name,
desc : v.area.desc,
});
areaTag : a.area.areaTag,
text : a.area.name, // standard
name : a.area.name,
desc : a.area.desc,
};
}));
areaListView.on('index update', areaIndex => {
@ -168,8 +157,7 @@ exports.getModule = class MessageAreaListModule extends MenuModule {
});
areaListView.redraw();
callback(null);
return callback(null);
}
],
function complete(err) {