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

26 lines
756 B
JavaScript
Raw Normal View History

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;