From: Mark Hayes Date: Fri, 8 Mar 2013 00:01:11 +0000 (-0800) Subject: firing toggle_checkbox and toggle_radio when clicking on custom radio/checkbox elemen... X-Git-Tag: v4.0.5~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbd23f4a720510cc63c0b0e233abd2493d696ff5;p=thirdparty%2Ffoundation%2Ffoundation-sites.git firing toggle_checkbox and toggle_radio when clicking on custom radio/checkbox elements does not appear to be necessary since the label already causes this event to be triggered --- diff --git a/js/foundation/foundation.forms.js b/js/foundation/foundation.forms.js index a8cd45689..43bf4515d 100644 --- a/js/foundation/foundation.forms.js +++ b/js/foundation/foundation.forms.js @@ -45,16 +45,6 @@ var self = this; $(this.scope) - .on('click.fndtn.forms', 'form.custom span.custom.checkbox', function (e) { - e.preventDefault(); - e.stopPropagation(); - self.toggle_checkbox($(this)); - }) - .on('click.fndtn.forms', 'form.custom span.custom.radio', function (e) { - e.preventDefault(); - e.stopPropagation(); - self.toggle_radio($(this)); - }) .on('change.fndtn.forms', 'form.custom select:not([data-customforms="disabled"])', function (e) { self.refresh_custom_select($(this)); }) @@ -66,6 +56,7 @@ if ($associatedElement.attr('type') === 'checkbox') { e.preventDefault(); $customCheckbox = $(this).find('span.custom.checkbox'); + //the checkbox might be outside after the label if ($customCheckbox.length == 0) { $customCheckbox = $(this).next('span.custom.checkbox');