ES6: All list views

This commit is contained in:
Robin Ward 2014-07-01 12:02:06 -04:00
parent de17c693fc
commit bad5938cdd
8 changed files with 11 additions and 37 deletions

View file

@ -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>

View file

@ -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>

View file

@ -1,4 +1,4 @@
Discourse.DiscoveryCategoriesView = Discourse.View.extend({
export default Discourse.View.extend({
orderingChanged: function(){
if (this.get("controller.ordering")) {

View file

@ -0,0 +1 @@
export default Discourse.View.extend(Discourse.ScrollTop);

View file

@ -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);

View file

@ -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'
});

View file

@ -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();

View file

@ -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'
});