From: Nic Haynes Date: Tue, 7 Aug 2012 01:18:31 +0000 (-0500) Subject: Update forms to delegate events X-Git-Tag: v3.0.8~7^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F762%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Update forms to delegate events Elements are not required to exist when DOM is loaded. --- diff --git a/vendor/assets/javascripts/foundation/jquery.foundation.forms.js b/vendor/assets/javascripts/foundation/jquery.foundation.forms.js index 11c2c61d0..73838ef21 100644 --- a/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +++ b/vendor/assets/javascripts/foundation/jquery.foundation.forms.js @@ -7,7 +7,7 @@ */ (function( $ ){ - + /** * Helper object used to quickly adjust all hidden parent element's, display and visibility properties. * This is currently used for the custom drop downs. When the dropdowns are contained within a reveal modal @@ -39,25 +39,25 @@ adjust : function( $child ) { // Internal reference. var _self = this; - + // Set all hidden parent elements, including this element. _self.hidden = $child.parents().andSelf().filter( ":hidden" ); - + // Loop through all hidden elements. _self.hidden.each( function() { - + // Cache the element. var $elem = $( this ); - + // Store the style attribute. // Undefined if element doesn't have a style attribute. _self.tmp.push( $elem.attr( 'style' ) ); - + // Set the element's display property to block, // but ensure it's visibility is hidden. $elem.css( { 'visibility' : 'hidden', 'display' : 'block' } ); }); - + }, // end adjust /** @@ -96,7 +96,7 @@ jQuery.foundation = jQuery.foundation || {}; jQuery.foundation.customForms = jQuery.foundation.customForms || {}; - + $.foundation.customForms.appendCustomMarkup = function ( options ) { var defaults = { @@ -207,7 +207,7 @@ // Insert the the currently selected list item before all other elements. // Then, find the element and assign it to $currentSelect. // - + $currentSelect = $customSelect.prepend( '' + $selectedOption.html() + '' ).find( ".current" ); // // Add the custom select element after the