This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/embedded_post_view.js

29 lines
645 B
JavaScript

/**
This view handles rendering of post within another (such as a collapsed reply)
@class EmbeddedPostView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.EmbeddedPostView = Discourse.View.extend({
templateName: 'embedded_post',
classNames: ['reply'],
init: function() {
this._super();
this.set('context', this.get('content'));
},
didInsertElement: function() {
Discourse.ScreenTrack.instance().track(this.get('elementId'), this.get('post.post_number'));
},
willDestroyElement: function() {
Discourse.ScreenTrack.instance().stopTracking(this.get('elementId'));
}
});