drupal/sites/all/themes/zen/zen-internals/js/theme-settings.js   A
last analyzed

Complexity

Total Complexity 7
Complexity/F 2.33

Size

Lines of Code 27
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 16
c 0
b 0
f 0
mnd 4
bc 4
fnc 3
dl 0
loc 27
rs 10
bpm 1.3333
cpm 2.3333
noi 2
1
$(document).ready( function() {
2
  // Hide the breadcrumb details, if no breadcrumb.
3
  $('#edit-zen-breadcrumb').change(
4
    function() {
5
      div = $('#div-zen-breadcrumb-collapse');
0 ignored issues
show
Bug introduced by
The variable div seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.div.
Loading history...
6
      if ($('#edit-zen-breadcrumb').val() == 'no') {
7
        div.slideUp('slow');
8
      } else if (div.css('display') == 'none') {
9
        div.slideDown('slow');
10
      }
11
    }
12
  );
13
  if ($('#edit-zen-breadcrumb').val() == 'no') {
14
    $('#div-zen-breadcrumb-collapse').css('display', 'none');
15
  }
16
  $('#edit-zen-breadcrumb-title').change(
17
    function() {
18
      checkbox = $('#edit-zen-breadcrumb-trailing');
0 ignored issues
show
Bug introduced by
The variable checkbox seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.checkbox.
Loading history...
19
      if ($('#edit-zen-breadcrumb-title').attr('checked')) {
20
        checkbox.attr('disabled', 'disabled');
21
      } else {
22
        checkbox.removeAttr('disabled');
23
      }
24
    }
25
  );
26
  $('#edit-zen-breadcrumb-title').change();
27
} );
28