viewing paste PostContentView | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
define('home/views/PostContentView',[
    'backbone-marionette',
 
    'core/bus',
    'core/mixins/withRichMedia',
 
    'home/templates/postContent',
], function (
    Marionette,
 
    bus,
    withRichMedia,
 
    postContentTemplate
) {
    'use strict';
 
    /**
     * A view of a just the content of a post, including rich media.
     */
    var PostContentView = Marionette.ItemView.extend({
        template: postContentTemplate,
        templateHelpers: function () {
            return {
                isHidden: this.model.get('state') !== 'visible',
            };
        },
 
        events: {
            'click a': 'trackClickLink',
        },
 
        trackClickLink: function (evt) {
            bus.trigger('uiAction:clickLink', evt, {
                adjective: 'message',
            });
        },
 
        onRender: function () {
            this.renderRichMedia(this.model.get('media'));
        },
    });
 
    withRichMedia.call(PostContentView.prototype);
 
    return PostContentView;
});
// https://c.disquscdn.com/next/current/home/js/views/PostContentView.js
 
 
Viewed 948 times, submitted by Guest.