diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index d1ffe39a0ce..d1dfbfaf8e5 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -1,7 +1,7 @@ {{post-gap post=this postStream=controller.postStream before="true"}}
- {{view Discourse.ReplyHistory contentBinding="replyHistory"}} + {{view 'reply-history' content=replyHistory}}
@@ -71,9 +71,9 @@ {{/if}} {{/if}} - {{view 'post-menu' post=this postView=view}} + {{view 'post-menu' post=this adminMenu=view.adminMenu}} - {{view Discourse.RepliesView content=replies postView=view}} + {{view 'replies' content=replies}} {{discourse-action-history post=this}} {{view 'topic-map-container' post=this topic=controller.model}} diff --git a/app/assets/javascripts/discourse/views/embedded_post_view.js b/app/assets/javascripts/discourse/views/embedded-post.js.es6 similarity index 73% rename from app/assets/javascripts/discourse/views/embedded_post_view.js rename to app/assets/javascripts/discourse/views/embedded-post.js.es6 index cde2661bd06..e62c8cf9a94 100644 --- a/app/assets/javascripts/discourse/views/embedded_post_view.js +++ b/app/assets/javascripts/discourse/views/embedded-post.js.es6 @@ -6,19 +6,17 @@ @namespace Discourse @module Discourse **/ -Discourse.EmbeddedPostView = Discourse.GroupedView.extend({ +export default Discourse.GroupedView.extend({ templateName: 'embedded_post', classNames: ['reply'], - didInsertElement: function() { + _startTracking: function() { var post = this.get('content'); Discourse.ScreenTrack.current().track(this.get('elementId'), post.get('post_number')); - }, + }.on('didInsertElement'), - willDestroyElement: function() { + _stopTracking: function() { Discourse.ScreenTrack.current().stopTracking(this.get('elementId')); - } + }.on('willDestroyElement') }); - - diff --git a/app/assets/javascripts/discourse/views/post-menu.js.es6 b/app/assets/javascripts/discourse/views/post-menu.js.es6 index e62eff47e4d..0c0450b56c8 100644 --- a/app/assets/javascripts/discourse/views/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/views/post-menu.js.es6 @@ -229,7 +229,7 @@ export default Discourse.View.extend({ var options = {className: 'create'}; if(!Discourse.Mobile.mobileView) { - options.textLabel = 'topic.reply.title' + options.textLabel = 'topic.reply.title'; } return new Button('reply', 'post.controls.reply', 'reply', options); @@ -273,7 +273,7 @@ export default Discourse.View.extend({ clickAdmin: function() { var $adminMenu = this.$('.post-admin-menu'); - this.set('postView.adminMenu', $adminMenu); + this.set('adminMenu', $adminMenu); $adminMenu.show(); }, diff --git a/app/assets/javascripts/discourse/views/replies_view.js b/app/assets/javascripts/discourse/views/replies.js.es6 similarity index 75% rename from app/assets/javascripts/discourse/views/replies_view.js rename to app/assets/javascripts/discourse/views/replies.js.es6 index d4aa7b645a2..42255b1ff33 100644 --- a/app/assets/javascripts/discourse/views/replies_view.js +++ b/app/assets/javascripts/discourse/views/replies.js.es6 @@ -6,11 +6,9 @@ @namespace Discourse @module Discourse **/ -Discourse.RepliesView = Ember.CollectionView.extend({ +export default Ember.CollectionView.extend({ tagName: 'section', classNameBindings: [':embedded-posts', ':bottom', 'hidden'], - itemViewClass: Discourse.EmbeddedPostView, + itemViewClass: 'embedded-post', hidden: Em.computed.equal('content.length', 0) }); - - diff --git a/app/assets/javascripts/discourse/views/reply_history.js b/app/assets/javascripts/discourse/views/reply-history.js.es6 similarity index 69% rename from app/assets/javascripts/discourse/views/reply_history.js rename to app/assets/javascripts/discourse/views/reply-history.js.es6 index b29749c0323..c5f81fa4779 100644 --- a/app/assets/javascripts/discourse/views/reply_history.js +++ b/app/assets/javascripts/discourse/views/reply-history.js.es6 @@ -2,14 +2,13 @@ Lists previous posts in the history of a post. @class ReplyHistory - @extends Discourse.EmbeddedPostView @namespace Discourse @module Discourse **/ -Discourse.ReplyHistory = Em.CollectionView.extend({ +export default Em.CollectionView.extend({ tagName: 'section', classNameBindings: [':embedded-posts', ':top', ':topic-body', ':offset2', 'hidden'], - itemViewClass: Discourse.EmbeddedPostView, + itemViewClass: 'embedded-post', hidden: Em.computed.equal('content.length', 0), previousPost: true });