open-nomad/ui/app/mixins/with-forbidden-state.js

18 lines
422 B
JavaScript
Raw Normal View History

import Mixin from '@ember/object/mixin';
// eslint-disable-next-line ember/no-new-mixins
export default Mixin.create({
setupController(controller) {
2019-03-26 07:46:44 +00:00
if (this.isForbidden) {
this.set('isForbidden', undefined);
controller.set('isForbidden', true);
}
this._super(...arguments);
},
resetController(controller) {
controller.set('isForbidden', false);
this._super(...arguments);
},
});