src/js/StaticSiteContentItem.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 14
c 0
b 0
f 0
dl 0
loc 22
rs 10
mnd 2
bc 2
fnc 2
bpm 1
cpm 2
noi 0
1
(function ($) {
2
    $('.readonly-click-toggle span').entwine({
3
4
        RawVal: null,
5
        ShowingRaw: true,
6
7
        onclick: function () {
8
            if (!$(this).getRawVal()) {
9
                $(this).setRawVal($(this).text());
10
            }
11
12
            if ($(this).getShowingRaw()) {
13
                $(this).html($(this).getRawVal());
14
                $(this).setShowingRaw(false);
15
            } else {
16
                $(this).text($(this).getRawVal());
17
                $(this).setShowingRaw(true);
18
            }
19
20
        }
21
    });
22
}(jQuery));