mirror of
https://github.com/discourse/discourse.git
synced 2025-06-08 00:27:32 +08:00
UX: Observe changes to plugin to hide/show plugin admin link without refresh.
This commit is contained in:
@ -1,9 +1,16 @@
|
|||||||
|
import computed from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
adminRoutes: function() {
|
@computed('model.@each.enabled_setting')
|
||||||
return this.get('model').map(p => {
|
adminRoutes() {
|
||||||
if (p.get('enabled')) {
|
let routes = []
|
||||||
return p.admin_route;
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user