Total Complexity | 3 |
Complexity/F | 1.5 |
Lines of Code | 16 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | $.fn.tree_checker = function() { |
||
2 | $(this).on('change', 'label > input[type="checkbox"]', function() { |
||
3 | if (this.checked) { |
||
4 | $(this).closest('li').find('li') |
||
5 | .removeClass('readonly') |
||
6 | .find('input').prop('disabled', false); |
||
7 | |||
8 | $(this).closest('label').removeClass('deselected'); |
||
9 | } else { |
||
10 | $(this).closest('li').find('li') |
||
11 | .addClass('readonly') |
||
12 | .find('input').prop('disabled', true); |
||
13 | $(this).closest('label').addClass('deselected'); |
||
14 | } |
||
15 | }); |
||
16 | } |
||
17 |