Resources/public/js/components/threads/edit/details/main.js   A
last analyzed

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 43
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
dl 0
loc 43
rs 10
c 0
b 0
f 0
cc 0
nc 1
mnd 0
bc 7
fnc 7
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B main.js ➔ define 0 38 1
1
/*
2
 * This file is part of Sulu.
3
 *
4
 * (c) MASSIVE ART WebServices GmbH
5
 *
6
 * This source file is subject to the MIT license that is bundled
7
 * with this source code in the file LICENSE.
8
 */
9
10
define([
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11
    'underscore',
12
    'jquery',
13
    'services/sulucomment/thread-manager',
14
    'text!/admin/comments/thread-template/details.html'
15
], function(_, $, Manager, form) {
16
17
    return {
18
19
        defaults: {
20
            templates: {
21
                form: form
22
            },
23
            translations: {
24
                title: 'public.title'
25
            }
26
        },
27
28
        type: 'form-tab',
29
30
        tabInitialize: function() {
31
            this.sandbox.on('sulu.content.changed', this.setDirty.bind(this));
32
        },
33
34
        parseData: function(data) {
35
            return data;
36
        },
37
38
        save: function(data) {
39
            Manager.save(data).then(function(data) {
40
                this.saved(data);
41
            }.bind(this));
42
        },
43
44
        getTemplate: function() {
45
            return this.templates.form({translations: this.translations, translate: this.sandbox.translate});
46
        },
47
48
        getFormId: function() {
49
            return '#thread-form';
50
        }
51
    };
52
});
53