2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2014-12-14 06:09:19 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
const {Mixin, computed, inject} = Ember;
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Mixin.create({
|
|
|
|
application: inject.controller(),
|
|
|
|
|
|
|
|
isViewingSubview: computed('application.showSettingsMenu', {
|
|
|
|
get() {
|
2014-12-14 06:09:19 +03:00
|
|
|
return false;
|
2015-06-03 05:56:42 +03:00
|
|
|
},
|
2015-10-28 14:36:45 +03:00
|
|
|
set(key, value) {
|
2015-06-03 05:56:42 +03:00
|
|
|
// Not viewing a subview if we can't even see the PSM
|
|
|
|
if (!this.get('application.showSettingsMenu')) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-12-14 06:09:19 +03:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
|
|
|
|
actions: {
|
2015-10-28 14:36:45 +03:00
|
|
|
showSubview() {
|
2014-12-14 06:09:19 +03:00
|
|
|
this.set('isViewingSubview', true);
|
|
|
|
},
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
closeSubview() {
|
2014-12-14 06:09:19 +03:00
|
|
|
this.set('isViewingSubview', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|