0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/controllers/settings/navigation.js
Paul Adam Davis 6cc5a58b68 Navigation UI Ember Integration
Closes #4537

- Adds Navigation to the Settings menu
- Adds a `navigationUI` config flag (redirects if not an editor or author)
2015-01-11 20:04:01 +00:00

25 lines
756 B
JavaScript

var NavigationController = Ember.Controller.extend(Ember.Evented, {
navigationJSON: Ember.computed('model.navigation', function () {
var navJSON = JSON.parse(this.get('model.navigation') || {}),
lastNavItem = navJSON[navJSON.length - 1];
lastNavItem.last = true; // Set a 'last' property on the last nav item, only used in the template
return navJSON;
}),
actions: {
addItem: function () {
// Add a new item
},
deleteItem: function () {
// Delete navItem which should be a function param like: `deleteItem: function(navItem) {`
},
save: function () {
// Save everything
}
}
});
export default NavigationController;