| Total Complexity | 4 |
| Complexity/F | 4 |
| Lines of Code | 21 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | $(document).on('ifChecked','.sonata-ba-field-inline-natural input[type="checkbox"], .sonata-ba-field-inline-table input[type="checkbox"]',function(e) { |
||
| 2 | var input = $(this); |
||
| 3 | var name = input.attr('name'); |
||
| 4 | |||
| 5 | if(name.match(/\[[0-9]*\]\[_delete\]/)) { |
||
| 6 | |||
| 7 | var formRow = input.closest('div.sonata-ba-tabs>div'); |
||
| 8 | |||
| 9 | if(formRow.length == 0) { |
||
| 10 | formRow = input.closest('tr'); |
||
| 11 | } |
||
| 12 | |||
| 13 | var r = confirm(Translator.trans('librinfo.confirm.delete_collection_item', {}, 'messages')); |
||
|
|
|||
| 14 | if (r == true) { |
||
| 15 | formRow.remove(); |
||
| 16 | } else { |
||
| 17 | // throw exception to avoid checkbox checking |
||
| 18 | e.dummy(); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | }); |
||
| 22 |
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.