mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
make primary and secondary nav sortable (fix #642)
This commit is contained in:
parent
4a415c6ebb
commit
a7ad1572c3
4 changed files with 35 additions and 7 deletions
|
@ -1,12 +1,12 @@
|
|||
Template[getTemplate('nav')].helpers({
|
||||
primaryNav: function () {
|
||||
return primaryNav;
|
||||
return _.sortBy(primaryNav, 'order');
|
||||
},
|
||||
hasPrimaryNav: function () {
|
||||
return !!primaryNav.length;
|
||||
},
|
||||
secondaryNav: function () {
|
||||
return secondaryNav;
|
||||
return _.sortBy(secondaryNav, 'order');
|
||||
},
|
||||
hasSecondaryNav: function () {
|
||||
return !!secondaryNav.length;
|
||||
|
@ -15,7 +15,7 @@ Template[getTemplate('nav')].helpers({
|
|||
return getThemeSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
|
||||
},
|
||||
getTemplate: function () {
|
||||
return getTemplate(this);
|
||||
return getTemplate(this.template);
|
||||
},
|
||||
userMenu: function () {
|
||||
return getTemplate('userMenu');
|
||||
|
|
|
@ -35,9 +35,31 @@ STATUS_REJECTED=3;
|
|||
|
||||
|
||||
// array containing nav items; initialize with views menu and admin menu
|
||||
primaryNav = ['viewsMenu', 'adminMenu'];
|
||||
primaryNav = [
|
||||
{
|
||||
template: 'viewsMenu',
|
||||
order: 10
|
||||
},
|
||||
{
|
||||
template: 'adminMenu',
|
||||
order: 20
|
||||
}
|
||||
];
|
||||
|
||||
secondaryNav = ['userMenu', 'notificationsMenu', 'submitButton'];
|
||||
secondaryNav = [
|
||||
{
|
||||
template: 'userMenu',
|
||||
order: 10
|
||||
},
|
||||
{
|
||||
template:'notificationsMenu',
|
||||
order: 20
|
||||
},
|
||||
{
|
||||
template: 'submitButton',
|
||||
order: 30
|
||||
}
|
||||
];
|
||||
|
||||
// array containing items in the admin menu
|
||||
adminNav = [
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// push "search" template to primaryNav
|
||||
primaryNav.push('search');
|
||||
primaryNav.push({
|
||||
template: 'search',
|
||||
order: 100
|
||||
});
|
||||
|
||||
adminNav.push({
|
||||
route: 'searchLogs',
|
||||
|
|
|
@ -56,7 +56,10 @@ postHeading.push({
|
|||
});
|
||||
|
||||
// push "categoriesMenu" template to primaryNav
|
||||
primaryNav.push('categoriesMenu');
|
||||
primaryNav.push({
|
||||
template: 'categoriesMenu',
|
||||
order: 50
|
||||
});
|
||||
|
||||
// push "categories" property to addToPostSchema, so that it's later added to postSchema
|
||||
addToPostSchema.push(
|
||||
|
|
Loading…
Add table
Reference in a new issue