mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
29 lines
745 B
JavaScript
29 lines
745 B
JavaScript
import Ember from 'ember';
|
|
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;
|