mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
UX: Observe changes to plugin to hide/show plugin admin link without refresh.
This commit is contained in:
parent
e721e31699
commit
fed7218deb
1 changed files with 13 additions and 6 deletions
|
@ -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'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return routes;
|
||||||
}
|
}
|
||||||
}).compact();
|
|
||||||
}.property()
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue