FIX: decorateCooked was not being applied to embedded posts

This commit is contained in:
Robin Ward 2015-06-01 11:58:17 -04:00
parent 81a699e2b0
commit b2a7411620
4 changed files with 10 additions and 12 deletions

View File

@ -11,6 +11,6 @@ export function decorateCooked(container, cb) {
decorate(postView, 'postViewInserted', cb);
decorate(postView, 'postViewUpdated', cb);
decorate(container.lookupFactory('view:composer'), 'previewRefreshed', cb);
decorate(container.lookupFactory('view:embedded-post'), 'previewRefreshed', cb);
decorate(container.lookupFactory('view:embedded-post'), 'didInsertElement', cb);
decorate(container.lookupFactory('view:user-stream'), 'didInsertElement', cb);
}

View File

@ -16,6 +16,5 @@
<div class='cooked'>
{{{unbound cooked}}}
</div>
</div>
</div>

View File

@ -1,9 +1,9 @@
export default Discourse.GroupedView.extend({
templateName: 'embedded_post',
templateName: 'embedded-post',
classNames: ['reply'],
_startTracking: function() {
var post = this.get('content');
const post = this.get('content');
Discourse.ScreenTrack.current().track(this.get('elementId'), post.get('post_number'));
}.on('didInsertElement'),

View File

@ -185,20 +185,19 @@ const PostView = Discourse.GroupedView.extend(Ember.Evented, {
actions: {
// Toggle the replies this post is a reply to
toggleReplyHistory(post) {
const replyHistory = post.get('replyHistory'),
topicController = this.get('controller'),
origScrollTop = $(window).scrollTop(),
replyPostNumber = this.get('post.reply_to_post_number'),
postNumber = this.get('post.post_number'),
self = this;
topicController = this.get('controller'),
origScrollTop = $(window).scrollTop(),
replyPostNumber = this.get('post.reply_to_post_number'),
postNumber = this.get('post.post_number'),
self = this;
if (Discourse.Mobile.mobileView) {
Discourse.URL.routeTo(this.get('post.topic').urlForPostNumber(replyPostNumber));
return;
}
const stream = topicController.get('postStream');
const stream = topicController.get('model.postStream');
const offsetFromTop = this.$().position().top - $(window).scrollTop();
if(Discourse.SiteSettings.experimental_reply_expansion) {
@ -223,7 +222,7 @@ const PostView = Discourse.GroupedView.extend(Ember.Evented, {
} else {
post.set('loadingReplyHistory', true);
topicController.get('postStream').findReplyHistory(post).then(function () {
stream.findReplyHistory(post).then(function () {
post.set('loadingReplyHistory', false);
Em.run.next(function() {