mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: displayCategoryDescription was not working correctly
This commit is contained in:
parent
77b5a49079
commit
5dd890eb3d
@ -6,7 +6,15 @@ import { categoryBadgeHTML } from "discourse/helpers/category-link";
|
|||||||
export default SelectKitRowComponent.extend({
|
export default SelectKitRowComponent.extend({
|
||||||
layoutName: "select-kit/templates/components/category-row",
|
layoutName: "select-kit/templates/components/category-row",
|
||||||
classNames: "category-row",
|
classNames: "category-row",
|
||||||
displayCategoryDescription: true,
|
|
||||||
|
@computed("options.displayCategoryDescription")
|
||||||
|
displayCategoryDescription(displayCategoryDescription) {
|
||||||
|
if (Ember.isNone(displayCategoryDescription)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return displayCategoryDescription;
|
||||||
|
},
|
||||||
|
|
||||||
@computed("computedContent.value", "computedContent.name")
|
@computed("computedContent.value", "computedContent.name")
|
||||||
category(value, name) {
|
category(value, name) {
|
||||||
@ -51,8 +59,8 @@ export default SelectKitRowComponent.extend({
|
|||||||
|
|
||||||
topicCount: Ember.computed.alias("category.topic_count"),
|
topicCount: Ember.computed.alias("category.topic_count"),
|
||||||
|
|
||||||
@computed("options.displayCategoryDescription", "category.description")
|
@computed("displayCategoryDescription", "category.description")
|
||||||
hasDescription(displayCategoryDescription, description) {
|
shouldDisplayDescription(displayCategoryDescription, description) {
|
||||||
return displayCategoryDescription && description && description !== "null";
|
return displayCategoryDescription && description && description !== "null";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -11,13 +11,13 @@ export default MultiSelectComponent.extend({
|
|||||||
init() {
|
init() {
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
this.set("headerComponentOptions", Ember.Object.create({
|
this.get("headerComponentOptions").setProperties({
|
||||||
selectedNameComponent: "multi-select/selected-category"
|
selectedNameComponent: "multi-select/selected-category"
|
||||||
}));
|
});
|
||||||
|
|
||||||
this.set("rowComponentOptions", Ember.Object.create({
|
this.get("rowComponentOptions").setProperties({
|
||||||
displayCategoryDescription: false
|
displayCategoryDescription: false
|
||||||
}));
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
computeValues() {
|
computeValues() {
|
||||||
|
@ -9,6 +9,14 @@ export default CategoryChooserComponent.extend({
|
|||||||
allowUncategorized: true,
|
allowUncategorized: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this._super();
|
||||||
|
|
||||||
|
this.get("rowComponentOptions").setProperties({
|
||||||
|
displayCategoryDescription: false
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
mutateValue(value) {
|
mutateValue(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
this.set("value", Category.findById(value));
|
this.set("value", Category.findById(value));
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if hasDescription}}
|
{{#if shouldDisplayDescription}}
|
||||||
<div class="category-desc">{{description}}</div>
|
<div class="category-desc">{{description}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
Loading…
Reference in New Issue
Block a user