lighthouse_garden/templates/assets/js/modal.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 13
rs 10
c 0
b 0
f 0
mnd 1
bc 1
fnc 1
bpm 1
cpm 2
noi 0
1
$('div[data-toggle="modal"]').on('click', function (event) {
2
  var button = $(this);
3
  var url = button.data('url');
4
  var target = button.data('target');
5
  var title = button.data('title');
6
  var modal = $(target);
7
  if (!url) {
8
    event.preventDefault();
9
  }
10
  modal.find('.modal-title').text(title);
11
  modal.find('.modal-body').html('<iframe src="' + url + '">');
12
  modal.find('.modal-body iframe').height(0.8 * $(document).height());
13
});