]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix custom form elements exclusion 970/head
authorEnigmaSolved <sean@enigmasolved.com>
Mon, 1 Oct 2012 16:45:21 +0000 (13:45 -0300)
committerEnigmaSolved <sean@enigmasolved.com>
Mon, 1 Oct 2012 16:45:21 +0000 (13:45 -0300)
I went looking for (and found!) the undocumented feature of the Custom Forms that if you add `data-customforms="disabled"` to an element in a custom form it will not be converted into the Foundation Custom version.  This is useful for instances when the developer wishes to use a particular form field in a different manner (eg, apply some other kind of custom form code to the field).  However, I discovered that the change I've made for this Pull Request is necessary for it to fully work.

vendor/assets/javascripts/foundation/jquery.foundation.forms.js

index 5753be4b2688826fdef11891e7ea0e0469d3a714..0a5316d6954a49f063c8c2d6a2587061bb1cd748 100644 (file)
   });
 
   $(document).on('click', 'form.custom label', function (event) {
-    var $associatedElement = $('#' + $(this).attr('for')),
+    var $associatedElement = $('#' + $(this).attr('for') + '[data-customforms!=disabled]'),
         $customCheckbox,
         $customRadio;
     if ($associatedElement.length !== 0) {