diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2018-09-03 20:49:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-03 20:49:30 +0200 |
| commit | bb77fdbe3e4f3605b201de5cdb96483d73b3dda4 (patch) | |
| tree | 9f50b4c23144a3ebf444aacbc1879d9b9341e2d1 /ihatemoney/static/js/ihatemoney.js | |
| parent | bfdcf31438a8fd8df440fec0d288e7183469747a (diff) | |
| download | ihatemoney-mirror-bb77fdbe3e4f3605b201de5cdb96483d73b3dda4.zip ihatemoney-mirror-bb77fdbe3e4f3605b201de5cdb96483d73b3dda4.tar.gz ihatemoney-mirror-bb77fdbe3e4f3605b201de5cdb96483d73b3dda4.tar.bz2 | |
Simplify a JS function. (#371)
Diffstat (limited to 'ihatemoney/static/js/ihatemoney.js')
| -rw-r--r-- | ihatemoney/static/js/ihatemoney.js | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/ihatemoney/static/js/ihatemoney.js b/ihatemoney/static/js/ihatemoney.js index 24e82b7..c240dc1 100644 --- a/ihatemoney/static/js/ihatemoney.js +++ b/ihatemoney/static/js/ihatemoney.js @@ -1,18 +1,7 @@ - // Add scripts to select all or non of the checkboxes in the add_bill form -function selectall() - { - var els = document.getElementsByName('payed_for'); - for(var i =0;i<els.length;i++) - { - els[i].checked=true; - } - } -function selectnone() - { - var els = document.getElementsByName('payed_for'); - for(var i =0;i<els.length;i++) - { - els[i].checked=false; - } - } - + // Utility to select all or none of the checkboxes in the add_bill form. +function selectCheckboxes(value){ + var els = document.getElementsByName('payed_for'); + for(var i = 0; i < els.length; i++){ + els[i].checked = value; + } +} |
