hide followers if empty

This commit is contained in:
yuri
2018-08-08 13:18:16 +03:00
parent d5b5bb31c7
commit eafd0c3840
@@ -94,6 +94,16 @@ Espo.define('views/record/panels/default-side', 'views/record/panels/side', func
if (this.getMetadata().get(['scopes', this.model.name ,'stream']) && !this.getUser().isPortal()) {
this.createField('followers', 'views/fields/followers', null, null, true);
this.controlFollowersField();
this.listenTo(this.model, 'change:followersIds', this.controlFollowersField, this);
}
},
controlFollowersField: function () {
if (this.model.get('followersIds') && this.model.get('followersIds').length) {
this.recordViewObject.showField('followers');
} else {
this.recordViewObject.hideField('followers');
}
}
});