make permissions dependend on array.length

This commit is contained in:
lislis 2016-04-06 12:38:20 +02:00
parent e3efe7d7fc
commit ae57f3903e

View File

@ -9,7 +9,7 @@ export default Ember.Component.extend({
isOpen: false, isOpen: false,
click(event) { click(event) {
if ($(event.target).is('a') && $(event.target).parents('.settings-dropdown').length) { if ($(event.target).is('a') && $(event.target).parents('.settings-dropdown').length) {
return this.closeMenu(); return this.closeMenu();
} }
}, },
@ -19,20 +19,20 @@ export default Ember.Component.extend({
}, },
actions: { actions: {
menu() { menu() {
return this.toggleProperty('isOpen'); return this.toggleProperty('isOpen');
} }
}, },
displaySettingsLink: function() { displaySettingsLink: function() {
return hasPushPermission(this.get('currentUser'), this.get('repo.id')); return hasPushPermission(this.get('currentUser'), this.get('repo.id'));
}.property('currentUser.pushPermissions', 'repo.id'), }.property('currentUser.pushPermissions.length', 'repo'),
displayCachesLink: function() { displayCachesLink: function() {
return hasPushPermission(this.get('currentUser'), this.get('repo.id')) && config.endpoints.caches; return hasPushPermission(this.get('currentUser'), this.get('repo.id')) && config.endpoints.caches;
}.property('currentUser.pushPermissions', 'repo.id'), }.property('currentUser.pushPermissions.length', 'repo'),
displayStatusImages: function() { displayStatusImages: function() {
return hasPermission(this.get('currentUser'), this.get('repo.id')); return hasPermission(this.get('currentUser'), this.get('repo.id'));
}.property('currentUser.permissions', 'repo.id') }.property('currentUser.permissions.length', 'repo.id')
}); });