T_IDENTIFIER   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 1
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 1
rs 10
c 0
b 0
f 0
cc 0
nc 1
mnd 1
bc 5
fnc 4
bpm 1.25
cpm 1.25
noi 1
1
document.addEventListener('DOMContentLoaded', function(){
2
//Get Modal
3
var modal = document.getElementById('vd-modal');
4
5
//Get button that opens modal
6
var btn_detail = document.getElementById('btn-detail');
7
8
//get close span 
9
var span_close = document.getElementsByClassName("close")[0];
10
11
12
// btn_detail onclick event
13
btn_detail.onclick = function(){
14
    modal.style.display = "block";
15
}
16
17
18
// span_close onclick event
19
 span_close.onclick = function(){
20
     modal.style.display = "none";
21
 }
22
23
24
//close when user clicks anywhere outside the modal
25
window.onclick = function(){
26
    if(event.target == modal){
0 ignored issues
show
Bug introduced by
The variable event seems to be never declared. If this is a global, consider adding a /** global: event */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
27
        modal.style.display = "none";
28
    }
29
}
30
}, false);
31