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.js.es6

18 lines
555 B
JavaScript

import ScreenTrack from 'discourse/lib/screen-track';
export default Discourse.GroupedView.extend({
templateName: 'embedded-post',
classNames: ['reply'],
attributeBindings: ['data-post-id'],
'data-post-id': Em.computed.alias('content.id'),
_startTracking: function() {
const post = this.get('content');
ScreenTrack.current().track(this.get('elementId'), post.get('post_number'));
}.on('didInsertElement'),
_stopTracking: function() {
ScreenTrack.current().stopTracking(this.get('elementId'));
}.on('willDestroyElement')
});