Total Complexity | 5 |
Complexity/F | 1.67 |
Lines of Code | 22 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | (function($) { |
||
2 | $(document).on('ready', function() { |
||
3 | var $actionsSelect, $formatsElement; |
||
4 | if ($('body').hasClass('grp-change-list')) { |
||
5 | // using grappelli |
||
6 | $actionsSelect = $('#grp-changelist-form select[name="action"]'); |
||
7 | $formatsElement = $('#grp-changelist-form select[name="file_format"]'); |
||
8 | } else { |
||
9 | // using default admin |
||
10 | $actionsSelect = $('#changelist-form select[name="action"]'); |
||
11 | $formatsElement = $('#changelist-form select[name="file_format"]').parent(); |
||
12 | } |
||
13 | $actionsSelect.on('change', function() { |
||
14 | if ($(this).val() === 'export_admin_action') { |
||
15 | $formatsElement.show(); |
||
16 | } else { |
||
17 | $formatsElement.hide(); |
||
18 | } |
||
19 | }); |
||
20 | $actionsSelect.change(); |
||
21 | }); |
||
22 | })(django.jQuery); |
||
|
|||
23 |
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.