Archive Project
This commit is contained in:
32
src/controllers/home.js
Normal file
32
src/controllers/home.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}));
|
||||
};
|
||||
Reference in New Issue
Block a user