From 4ef1061fc59e3be9ace487acfa37a0ccf200491b Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 23 Jun 2018 11:17:21 -0600 Subject: [PATCH] Use standard list format for message area select --- core/msg_area_list.js | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/core/msg_area_list.js b/core/msg_area_list.js index 27cbcbb1..1b9870bd 100644 --- a/core/msg_area_list.js +++ b/core/msg_area_list.js @@ -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, { - index : i++, - areaTag : v.area.areaTag, - name : v.area.name, - desc : v.area.desc, - }); + let i = 1; + areaListView.setItems(self.messageAreas.map(a => { + return { + index : i++, + 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) {