role select style
This commit is contained in:
@@ -94,6 +94,11 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView {
|
||||
this.skipRoles = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.roleType === this.ROLE_TYPE_ENUM) {
|
||||
this.styleMap = /** @type {Record<string>}*/ this.getMetadata()
|
||||
.get(['entityDefs', this.model.entityType, 'fields', this.roleField, 'style']) || {};
|
||||
}
|
||||
}
|
||||
|
||||
getAttributeList() {
|
||||
@@ -136,8 +141,7 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView {
|
||||
}
|
||||
|
||||
if (role) {
|
||||
let style = this.getMetadata()
|
||||
.get(['entityDefs', this.model.entityType, 'fields', this.roleField, 'style', role]);
|
||||
let style = this.styleMap[role];
|
||||
|
||||
let className = 'text';
|
||||
|
||||
@@ -242,6 +246,12 @@ class LinkMultipleWithRoleFieldView extends LinkMultipleFieldView {
|
||||
$option.attr('selected', 'selected');
|
||||
}
|
||||
|
||||
const style = this.styleMap[role];
|
||||
|
||||
if (style) {
|
||||
$option.addClass('text-' + style)
|
||||
}
|
||||
|
||||
$role.append($option);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user