| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import forEach from 'lodash.foreach' |
||
| 4 | function selectedTotal() { |
||
| 5 | let total = 0.0 |
||
| 6 | |||
| 7 | forEach( |
||
| 8 | document.getElementsByClassName('charges__item-checkbox-input'), |
||
| 9 | element => { |
||
| 10 | if (element.checked) { |
||
| 11 | total += Number.parseFloat(element.dataset.feeBalance) |
||
| 12 | } |
||
| 13 | } |
||
| 14 | ) |
||
| 15 | |||
| 16 | document.getElementById('totalSelectedAmount').innerHTML = `$${currency( |
||
| 17 | total |
||
| 18 | )}` |
||
| 19 | |||
| 20 | if (total > 0) { |
||
| 21 | document.getElementById('submitButton').removeAttribute('disabled') |
||
| 22 | } else { |
||
| 23 | document.getElementById('submitButton').setAttribute('disabled', 'disabled') |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 41 |