From 814da28b737aaaa76098baceedcb69b9f8d8910d Mon Sep 17 00:00:00 2001 From: Nic Haynes Date: Mon, 6 Aug 2012 20:18:31 -0500 Subject: [PATCH] Update forms to delegate events Elements are not required to exist when DOM is loaded. --- .../foundation/jquery.foundation.forms.js | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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