mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-29 00:00:33 -04:00
ES6: All list views
This commit is contained in:
parent
de17c693fc
commit
bad5938cdd
8 changed files with 11 additions and 37 deletions
app/assets/javascripts/discourse
|
@ -62,7 +62,7 @@
|
|||
{{/if}}
|
||||
|
||||
<tbody>
|
||||
{{each topics itemController="topic-list-item" itemViewClass="Discourse.TopicListItemView"}}
|
||||
{{each topics itemController="topic-list-item" itemView="topic-list-item"}}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
{{/if}}
|
||||
{{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}}
|
||||
{{collection contentBinding="topics" tagName="tbody" itemView="topic-list-item"}}
|
||||
</table>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Discourse.DiscoveryCategoriesView = Discourse.View.extend({
|
||||
export default Discourse.View.extend({
|
||||
|
||||
orderingChanged: function(){
|
||||
if (this.get("controller.ordering")) {
|
|
@ -0,0 +1 @@
|
|||
export default Discourse.View.extend(Discourse.ScrollTop);
|
|
@ -1,9 +0,0 @@
|
|||
/**
|
||||
This view handles the rendering of the top lists
|
||||
|
||||
@class DiscoveryTopView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.DiscoveryTopView = Discourse.View.extend(Discourse.ScrollTop);
|
|
@ -1,15 +0,0 @@
|
|||
/**
|
||||
This view is used for rendering a basic list of topics on a user's page.
|
||||
|
||||
@class UserTopicsListView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@uses Discourse.LoadMore
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.UserTopicsListView = Discourse.View.extend(Discourse.LoadMore, {
|
||||
classNames: ['paginated-topics-list'],
|
||||
eyelineSelector: '.paginated-topics-list #topic-list tr',
|
||||
templateName: 'list/user_topics_list'
|
||||
});
|
||||
|
|
@ -1,12 +1,4 @@
|
|||
/**
|
||||
This view handles the rendering of a topic in a list
|
||||
|
||||
@class TopicListItemView
|
||||
@extends Discourse.GroupedView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicListItemView = Discourse.GroupedView.extend({
|
||||
export default Discourse.GroupedView.extend({
|
||||
tagName: 'tr',
|
||||
templateName: 'list/topic_list_item',
|
||||
classNameBindings: ['controller.checked', 'content.archived', ':topic-list-item', 'content.hasExcerpt:has-excerpt'],
|
||||
|
@ -27,7 +19,7 @@ Discourse.TopicListItemView = Discourse.GroupedView.extend({
|
|||
_highlightIfNeeded: function() {
|
||||
var session = Discourse.Session.current();
|
||||
|
||||
// highligth the last topic viewed
|
||||
// highlight the last topic viewed
|
||||
if (session.get('lastTopicIdViewed') === this.get('content.id')) {
|
||||
session.set('lastTopicIdViewed', null);
|
||||
this.highlight();
|
|
@ -0,0 +1,5 @@
|
|||
export default Discourse.View.extend(Discourse.LoadMore, {
|
||||
classNames: ['paginated-topics-list'],
|
||||
eyelineSelector: '.paginated-topics-list #topic-list tr',
|
||||
templateName: 'list/user_topics_list'
|
||||
});
|
Loading…
Add table
Reference in a new issue