phpcollective /
menumaker
| 1 | let except = $('#js-response').data('except'), |
||
| 2 | ancestors = JSON.parse("[" + $('#js-response').data('ancestors') + "]"); |
||
| 3 | |||
| 4 | function menus(element) { |
||
| 5 | let parent_id = element.val() || 0, |
||
| 6 | parentCount = $('select.parent').length, |
||
| 7 | target = element.data('target'), |
||
| 8 | url = baseUrl() + 'filter-menus?p_id=' + parent_id + '&e_id=' + except + '&pCount=' + parentCount; |
||
| 9 | $.get(url, function(data, status){ |
||
|
0 ignored issues
–
show
|
|||
| 10 | $(document).find('#child-of-parent-' + target).html(data); |
||
| 11 | if(ancestors.length > 0) |
||
| 12 | { |
||
| 13 | $(document).find('select.parent:last').val(ancestors.shift()).change(); |
||
| 14 | } |
||
| 15 | }); |
||
| 16 | } |
||
| 17 | |||
| 18 | $(function () { |
||
| 19 | $(document).on('change', '.parent', function (e) { |
||
|
0 ignored issues
–
show
|
|||
| 20 | menus($(this)); |
||
| 21 | }); |
||
| 22 | |||
| 23 | if(ancestors.length > 0) |
||
| 24 | { |
||
| 25 | $(document).find('select.parent:last').val(ancestors.shift()).change(); |
||
| 26 | } |
||
| 27 | }); |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.