mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
6cc5a58b68
Closes #4537 - Adds Navigation to the Settings menu - Adds a `navigationUI` config flag (redirects if not an editor or author)
25 lines
756 B
JavaScript
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;
|