From dbd23f4a720510cc63c0b0e233abd2493d696ff5 Mon Sep 17 00:00:00 2001 From: Mark Hayes Date: Thu, 7 Mar 2013 16:01:11 -0800 Subject: [PATCH] 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 --- js/foundation/foundation.forms.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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'); -- 2.47.3