FIX: category row title (#6597)

This commit is contained in:
Joffrey JAFFEUX 2018-11-13 13:35:45 +01:00 committed by GitHub
parent 4a12cfaecb
commit c1e82e7442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 7 deletions

View File

@ -20,10 +20,9 @@ export default SelectKitRowComponent.extend({
return displayCategoryDescription;
},
@computed("description", "category.name")
title(categoryDescription, categoryName) {
if (categoryDescription) return categoryDescription;
return categoryName;
@computed("descriptionText", "description", "category.name")
title(descriptionText, description, name) {
return descriptionText || description || name;
},
@computed("computedContent.value", "computedContent.name")
@ -84,12 +83,23 @@ export default SelectKitRowComponent.extend({
return displayCategoryDescription && description && description !== "null";
},
@computed("category.description_text")
descriptionText(description) {
if (description) {
return this._formatCategoryDescription(description);
}
},
@computed("category.description")
description(description) {
if (description) {
return `${description.substr(0, 200)}${
description.length > 200 ? "…" : ""
}`;
return this._formatCategoryDescription(description);
}
},
_formatCategoryDescription(description) {
return `${description.substr(0, 200)}${
description.length > 200 ? "…" : ""
}`;
}
});