mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-04 19:21:07 +01:00
feat(core): load torrent type submenu items from torrent.js configure items
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
.module('torrents')
|
||||
.run(menuConfig);
|
||||
|
||||
menuConfig.$inject = ['menuService'];
|
||||
menuConfig.$inject = ['menuService', 'MeanTorrentConfig'];
|
||||
|
||||
function menuConfig(menuService, MeanTorrentConfig) {
|
||||
var torrentTypeConfig = MeanTorrentConfig.meanTorrentConfig.torrentType;
|
||||
console.log(torrentTypeConfig);
|
||||
|
||||
function menuConfig(menuService) {
|
||||
menuService.addMenuItem('topbar', {
|
||||
title: 'MENU_TORRENTS',
|
||||
state: 'torrents',
|
||||
@@ -17,31 +20,42 @@
|
||||
});
|
||||
|
||||
// Add the dropdown list item
|
||||
menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
title: 'MENU_TORRENTS_SUB.MOVIE',
|
||||
state: 'torrents.movie',
|
||||
roles: ['*']
|
||||
});
|
||||
menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
title: 'MENU_TORRENTS_SUB.TVSERIAL',
|
||||
state: 'torrents.tvserial',
|
||||
roles: ['*']
|
||||
});
|
||||
menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
title: 'MENU_TORRENTS_SUB.MUSIC',
|
||||
state: 'torrents.music',
|
||||
roles: ['*']
|
||||
});
|
||||
menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
title: 'MENU_TORRENTS_SUB.OTHER',
|
||||
state: 'torrents.other',
|
||||
roles: ['*']
|
||||
});
|
||||
menuService.addMenuItem('topbar', {
|
||||
title: 'MENU_UPLOAD',
|
||||
state: 'torrents.uploads',
|
||||
roles: ['*'],
|
||||
position: 3
|
||||
angular.forEach(torrentTypeConfig.value, function (cfg) {
|
||||
menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
title: cfg.title,
|
||||
state: cfg.state,
|
||||
divider: cfg.divider,
|
||||
roles: ['*'],
|
||||
position: cfg.position
|
||||
});
|
||||
});
|
||||
//
|
||||
//
|
||||
//menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
// title: 'MENU_TORRENTS_SUB.MOVIE',
|
||||
// state: 'torrents.movie',
|
||||
// roles: ['*']
|
||||
//});
|
||||
//menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
// title: 'MENU_TORRENTS_SUB.TVSERIAL',
|
||||
// state: 'torrents.tvserial',
|
||||
// roles: ['*']
|
||||
//});
|
||||
//menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
// title: 'MENU_TORRENTS_SUB.MUSIC',
|
||||
// state: 'torrents.music',
|
||||
// roles: ['*']
|
||||
//});
|
||||
//menuService.addSubMenuItem('topbar', 'torrents', {
|
||||
// title: 'MENU_TORRENTS_SUB.OTHER',
|
||||
// state: 'torrents.other',
|
||||
// roles: ['*']
|
||||
//});
|
||||
//menuService.addMenuItem('topbar', {
|
||||
// title: 'MENU_UPLOAD',
|
||||
// state: 'torrents.uploads',
|
||||
// roles: ['*'],
|
||||
// position: 3
|
||||
//});
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user