Sha256: bf81b074543f501a0458775907a5996673af72424c16ecfde11933dd3ec6ab55
Contents?: true
Size: 659 Bytes
Versions: 7
Compression:
Stored size: 659 Bytes
Contents
/** radioControlsVisibilityOfElement: Apply to individual radio button that makes another element visible when checked **/ document.addEventListener('DOMContentLoaded', function() { $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector) { if (!this.get(0)) { return } var showValue = this.get(0).value var radioGroup = $("input[name='" + this.get(0).name + "']") radioGroup.each(function() { $(this).click(function() { // eslint-disable-next-line eqeqeq $(dependentElementSelector).visible(this.checked && this.value == showValue) }) if (this.checked) { this.click() } }) } })
Version data entries
7 entries across 7 versions & 1 rubygems