const homeController = new TKController({ id: 'home', actions: [ {selector: '.play', action: bookletController.playFeature} ], navigatesTo: [ {selector: '.features', controller: 'features'} ], highlightedElement: '.play' }); homeController.viewDidLoad = function () { let mainMenuItems = []; mainMenuItems.push({ type: 'div', className: 'play button', content: _('Play') }); if (typeof appData.features !== 'undefined' && appData.features.length > 0) { mainMenuItems.push({ type: 'div', className: 'features button', content: _('Features') }) } this.view.appendChild(TKUtils.buildElement({ type: 'container', className: 'main-menu', children: mainMenuItems })); };