Ghost/core/client/app/mixins/settings-menu-controller.js

31 lines
692 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
const {Mixin, computed, inject} = Ember;
export default Mixin.create({
application: inject.controller(),
isViewingSubview: computed('application.showSettingsMenu', {
get() {
return false;
},
set(key, value) {
// Not viewing a subview if we can't even see the PSM
if (!this.get('application.showSettingsMenu')) {
return false;
}
return value;
}
}),
actions: {
showSubview() {
this.set('isViewingSubview', true);
},
closeSubview() {
this.set('isViewingSubview', false);
}
}
});