Sha256: 5f70cc9ff5f35b80ab51178da31cce511e42a7204f8fd84517cd034c4b997dab
Contents?: true
Size: 653 Bytes
Versions: 16
Compression:
Stored size: 653 Bytes
Contents
/** radioControlsVisibilityOfElement: Apply to individual radio button that makes another element visible when checked **/ document.addEventListener("spree:load", 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
16 entries across 16 versions & 1 rubygems