mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 02:14:29 +08:00
FIX: use separate site attribute for single category "top tags" list.
And use it only in the single category pages. 38dd184a16f38fed1f011eeb39de580a301b8f4e
This commit is contained in:
parent
330d1ae9bc
commit
2e397c78c4
app/assets/javascripts
@ -67,7 +67,11 @@ function findTopicList(store, tracking, filter, filterParams, extras) {
|
|||||||
}
|
}
|
||||||
Session.currentProp("topicList", list);
|
Session.currentProp("topicList", list);
|
||||||
if (list.topic_list && list.topic_list.top_tags) {
|
if (list.topic_list && list.topic_list.top_tags) {
|
||||||
Site.currentProp("top_tags", list.topic_list.top_tags);
|
if (list.filter.startsWith("c/")) {
|
||||||
|
Site.currentProp("category_top_tags", list.topic_list.top_tags);
|
||||||
|
} else {
|
||||||
|
Site.currentProp("top_tags", list.topic_list.top_tags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
});
|
});
|
||||||
|
@ -107,7 +107,19 @@ export default ComboBoxComponent.extend(TagsMixin, {
|
|||||||
return shortcuts;
|
return shortcuts;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
topTags: readOnly("site.top_tags.[]"),
|
topTags: computed(
|
||||||
|
"firstCategory",
|
||||||
|
"secondCategory",
|
||||||
|
"site.category_top_tags.[]",
|
||||||
|
"site.top_tags.[]",
|
||||||
|
function() {
|
||||||
|
if (this.currentCategory && this.site.category_top_tags) {
|
||||||
|
return this.site.category_top_tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.site.top_tags;
|
||||||
|
}
|
||||||
|
),
|
||||||
|
|
||||||
content: computed("topTags.[]", "shortcuts.[]", function() {
|
content: computed("topTags.[]", "shortcuts.[]", function() {
|
||||||
if (this.sortTagsAlphabetically && this.topTags) {
|
if (this.sortTagsAlphabetically && this.topTags) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user