Test Setup Failed
Push — master ( 982d9a...a2862f )
by
unknown
03:40
created

comment-view.js ➔ ... ➔ CommentView   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
define([
2
    'oronote/js/app/views/note-view',
3
    'autolinker'
4
], function(NoteView, autolinker) {
5
    'use strict';
6
7
    var CommentView;
8
9
    CommentView = NoteView.extend({
10
        /**
11
         * @inheritDoc
12
         */
13
        constructor: function CommentView() {
14
            CommentView.__super__.constructor.apply(this, arguments);
15
        },
16
17
        /**
18
         * Returns class name for root element
19
         * @returns {string}
20
         */
21
        className: function() {
22
            return 'list-item' + (this.model.get('public') ? '' : ' private');
23
        },
24
25
        /**
26
         * @return {Object}
27
         */
28
        getTemplateData: function() {
29
            var data = this.model.toJSON();
30
31
            data.collapsed = this.collapsed;
32
            data.message = autolinker.link(data.message, {className: 'no-hash'});
33
            data.briefMessage = autolinker.link(data.briefMessage, {className: 'no-hash'});
34
35
            return data;
36
        }
37
    });
38
39
    return CommentView;
40
});
41