Sha256: 9d1116bf9d07d61c630bc074bb20bdb82a45db6b44dc923f8bda2fea2ad2c247
Contents?: true
Size: 533 Bytes
Versions: 18
Compression:
Stored size: 533 Bytes
Contents
/* eslint-disable no-invalid-this, no-undefined */ $(document).ready(function () { 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
18 entries across 18 versions & 1 rubygems