Passed
Push — master ( 572bc3...498a3b )
by Ronan
06:35 queued 01:29
created

resources/js/components/_app.deploy.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 30
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 20
c 0
b 0
f 0
dl 0
loc 30
rs 10
mnd 0
bc 0
fnc 5
bpm 0
cpm 1
noi 0
1
/** global: App **/
2
var App = App || {};
3
4
App.Deploy = {
5
6
    defaults: {
7
        trigger: '#dropdown-trigger-deploy',
8
        content_selector: '#dropdown-deploy .dropdown-content',
9
        project: null,
10
    },
11
    options: {},
12
13
    init: function (options) {
14
        this.options = $.extend({}, this.defaults, options);
15
        this.bindUI();
16
    },
17
    bindUI: function () {
18
        var that = this;
19
        $(this.options.trigger).on('click', function (e) {
20
            e.preventDefault();
21
            that._load(this);
22
        });
23
    },
24
    unBindUI: function () {
25
    },
26
27
    _load: function () {
28
        var url = '/prepare-deploy/' + this.options.project;
29
        $(this.options.content_selector).load(url);
30
    }
31
}
32