Ghost/ghost/admin/mixins/settings-menu-controller.js
Matt Enlow 0d95ce4b8a Create settings-menu-mixin for subview state tracking
Ref #4642
- Move duplicate code from PSM and SettingsTags to a mixin
2014-12-13 20:37:36 -07:00

28 lines
718 B
JavaScript

var SettingsMenuControllerMixin = Ember.Mixin.create({
needs: 'application',
isViewingSubview: Ember.computed('controllers.application.showSettingsMenu', function (key, value) {
// Not viewing a subview if we can't even see the PSM
if (!this.get('controllers.application.showSettingsMenu')) {
return false;
}
if (arguments.length > 1) {
return value;
}
return false;
}),
actions: {
showSubview: function () {
this.set('isViewingSubview', true);
},
closeSubview: function () {
this.set('isViewingSubview', false);
}
}
});
export default SettingsMenuControllerMixin;