2016-06-30 13:21:47 +03:00
|
|
|
import Mixin from 'ember-metal/mixin';
|
|
|
|
import computed from 'ember-computed';
|
|
|
|
import injectController from 'ember-controller/inject';
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Mixin.create({
|
2016-06-30 13:21:47 +03:00
|
|
|
application: injectController(),
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|