UX: Observe changes to plugin to hide/show plugin admin link without refresh.
This commit is contained in:
parent
e721e31699
commit
fed7218deb
|
@ -1,9 +1,16 @@
|
|||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
adminRoutes: function() {
|
||||
return this.get('model').map(p => {
|
||||
if (p.get('enabled')) {
|
||||
return p.admin_route;
|
||||
@computed('model.@each.enabled_setting')
|
||||
adminRoutes() {
|
||||
let routes = []
|
||||
|
||||
this.get('model').forEach(p => {
|
||||
if (this.siteSettings[p.get('enabled_setting')] && p.get('admin_route')) {
|
||||
routes.push(p.get('admin_route'));
|
||||
}
|
||||
}).compact();
|
||||
}.property()
|
||||
});
|
||||
|
||||
return routes;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue