Merge pull request #4315 from tgxworld/fix_tags_not_in_category_showing

Tags which are not allowed in a category showing in drop down.
This commit is contained in:
Guo Xiang Tan
2016-07-08 10:28:10 +08:00
committed by GitHub
9 changed files with 70 additions and 28 deletions
@@ -1,4 +1,5 @@
import { setting } from 'discourse/lib/computed';
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
classNameBindings: [':tag-drop', 'tag::no-category', 'tags:has-drop','categoryStyle','tagClass'],
@@ -10,13 +11,14 @@ export default Ember.Component.extend({
tagName: 'li',
tags: function() {
if (this.siteSettings.tags_sort_alphabetically && Discourse.Site.currentProp('top_tags')) {
return Discourse.Site.currentProp('top_tags').sort();
@computed('site.top_tags')
tags(topTags) {
if (this.siteSettings.tags_sort_alphabetically && topTags) {
return topTags.sort();
} else {
return Discourse.Site.currentProp('top_tags');
return topTags;
}
}.property('site.top_tags'),
},
iconClass: function() {
if (this.get('expanded')) { return "fa fa-caret-down"; }
@@ -67,6 +67,9 @@ export default (filter, params) => {
return findTopicList(this.store, this.topicTrackingState, listFilter, findOpts, extras).then(list => {
TopicList.hideUniformCategory(list, category);
this.set('topics', list);
if (list.topic_list.tags) {
Discourse.Site.currentProp('top_tags', list.topic_list.tags);
}
return list;
});
},