Sha256: ad36b33cd372ce8b8aa122814d697053ca7cdc415f0d5b1c3bb079532a5b2ff1
Contents?: true
Size: 512 Bytes
Versions: 31
Compression:
Stored size: 512 Bytes
Contents
/* eslint-disable no-invalid-this, no-undefined */ $(() => { let $remainingVotesCount = $("#remaining-votes-count"); $('form .multiple_votes_form input[type="checkbox"]').on("change", function(event) { let max = parseInt($remainingVotesCount.text(), 10); if ($(this).is(":checked")) { max -= 1; } else { max += 1; } if (max < 0) { $(this).prop("checked", false); event.preventDefault(); } else { $remainingVotesCount.text(max); } }); });
Version data entries
31 entries across 31 versions & 1 rubygems