mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
ES6: All list views
This commit is contained in:
parent
de17c693fc
commit
bad5938cdd
@ -62,7 +62,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{each topics itemController="topic-list-item" itemViewClass="Discourse.TopicListItemView"}}
|
{{each topics itemController="topic-list-item" itemView="topic-list-item"}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}}
|
{{collection contentBinding="topics" tagName="tbody" itemView="topic-list-item"}}
|
||||||
</table>
|
</table>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Discourse.DiscoveryCategoriesView = Discourse.View.extend({
|
export default Discourse.View.extend({
|
||||||
|
|
||||||
orderingChanged: function(){
|
orderingChanged: function(){
|
||||||
if (this.get("controller.ordering")) {
|
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 @@
|
|||||||
/**
|
export default Discourse.GroupedView.extend({
|
||||||
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({
|
|
||||||
tagName: 'tr',
|
tagName: 'tr',
|
||||||
templateName: 'list/topic_list_item',
|
templateName: 'list/topic_list_item',
|
||||||
classNameBindings: ['controller.checked', 'content.archived', ':topic-list-item', 'content.hasExcerpt:has-excerpt'],
|
classNameBindings: ['controller.checked', 'content.archived', ':topic-list-item', 'content.hasExcerpt:has-excerpt'],
|
||||||
@ -27,7 +19,7 @@ Discourse.TopicListItemView = Discourse.GroupedView.extend({
|
|||||||
_highlightIfNeeded: function() {
|
_highlightIfNeeded: function() {
|
||||||
var session = Discourse.Session.current();
|
var session = Discourse.Session.current();
|
||||||
|
|
||||||
// highligth the last topic viewed
|
// highlight the last topic viewed
|
||||||
if (session.get('lastTopicIdViewed') === this.get('content.id')) {
|
if (session.get('lastTopicIdViewed') === this.get('content.id')) {
|
||||||
session.set('lastTopicIdViewed', null);
|
session.set('lastTopicIdViewed', null);
|
||||||
this.highlight();
|
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…
Reference in New Issue
Block a user