Move topic list extensibility to `topic-list` component
This commit is contained in:
parent
eb85922083
commit
4d8619f62c
|
@ -52,7 +52,8 @@ export default Ember.Component.extend(bufferedRender({
|
|||
classes.push('has-excerpt');
|
||||
}
|
||||
|
||||
_.each(['liked', 'archived', 'bookmarked'],function(name) {
|
||||
|
||||
['liked', 'archived', 'bookmarked', 'pinned'].forEach(name => {
|
||||
if (topic.get(name)) {
|
||||
classes.push(name);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@ export default Ember.Component.extend({
|
|||
classNames: ['topic-list'],
|
||||
showTopicPostBadges: true,
|
||||
|
||||
// Overwrite this to perform client side filtering of topics, if desired
|
||||
filteredTopics: Ember.computed.alias('topics'),
|
||||
|
||||
_init: function(){
|
||||
this.addObserver('hideCategory', this.rerender);
|
||||
this.addObserver('order', this.rerender);
|
||||
|
|
|
@ -25,9 +25,6 @@ const controllerOpts = {
|
|||
this.setProperties({ order: "default", ascending: false });
|
||||
},
|
||||
|
||||
// Overwrite this to perform client side filtering of topics, if desired
|
||||
filteredTopics: Ember.computed.alias('model.topics'),
|
||||
|
||||
actions: {
|
||||
|
||||
changeSort(sortBy) {
|
||||
|
|
|
@ -14,8 +14,20 @@
|
|||
bulkSelectEnabled=bulkSelectEnabled}}
|
||||
</thead>
|
||||
{{/unless}}
|
||||
|
||||
{{plugin-outlet
|
||||
name="before-topic-list-body"
|
||||
args=(hash
|
||||
topics=topics
|
||||
selected=selected
|
||||
bulkSelectEnabled=bulkSelectEnabled
|
||||
lastVisitedTopic=lastVisitedTopic
|
||||
discoveryList=discoveryList)
|
||||
tagName=""
|
||||
connectorTagName=""}}
|
||||
|
||||
<tbody>
|
||||
{{#each topics as |topic|}}
|
||||
{{#each filteredTopics as |topic|}}
|
||||
{{topic-list-item topic=topic
|
||||
bulkSelectEnabled=bulkSelectEnabled
|
||||
showTopicPostBadges=showTopicPostBadges
|
||||
|
|
|
@ -32,12 +32,6 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if hasTopics}}
|
||||
|
||||
{{plugin-outlet
|
||||
name="discovery-before-topic-list"
|
||||
tagName=""
|
||||
args=(hash model=model category=category)}}
|
||||
|
||||
{{topic-list
|
||||
highlightLastVisited=true
|
||||
top=top
|
||||
|
@ -54,7 +48,8 @@
|
|||
expandGloballyPinned=expandGloballyPinned
|
||||
expandAllPinned=expandAllPinned
|
||||
category=category
|
||||
topics=filteredTopics}}
|
||||
topics=model.topics
|
||||
discoveryList=true}}
|
||||
{{/if}}
|
||||
{{/discovery-topics-list}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue