vendor/assets/javascripts/foundation/app.js in zurb-foundation-3.0.9 vs vendor/assets/javascripts/foundation/app.js in zurb-foundation-3.1.0.rc1

- old
+ new

@@ -1,22 +1,34 @@ -(function ($) { +;(function ($, window, undefined) { + 'use strict'; - $(function(){ - $(document).foundationAlerts(); - $(document).foundationButtons(); - $(document).foundationAccordion(); - $(document).foundationNavigation(); - $(document).foundationCustomForms(); - $(document).foundationMediaQueryViewer(); - $(document).foundationTabs({callback:$.foundation.customForms.appendCustomMarkup}); - - $(document).tooltips(); - $('input, textarea').placeholder(); - - // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids - // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'}); - // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'}); - // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'}); - // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'}); - }); - -})(jQuery); + var $doc = $(document), + Modernizr = window.Modernizr; + + $.fn.foundationAlerts ? $doc.foundationAlerts() : null; + $.fn.foundationButtons ? $doc.foundationButtons() : null; + $.fn.foundationAccordion ? $doc.foundationAccordion() : null; + $.fn.foundationNavigation ? $doc.foundationNavigation() : null; + $.fn.foundationTopBar ? $doc.foundationTopBar({breakPoint: 900}) : null; + $.fn.foundationCustomForms ? $doc.foundationCustomForms() : null; + $.fn.foundationMediaQueryViewer ? $doc.foundationMediaQueryViewer() : null; + $.fn.foundationTabs ? $doc.foundationTabs({callback : $.foundation.customForms.appendCustomMarkup}) : null; + $.fn.foundationTooltips ? $doc.foundationTooltips() : null; + + $('input, textarea').placeholder(); + + // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids + // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'}); + // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'both'}); + // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'both'}); + // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'both'}); + + // Hide address bar on mobile devices + if (Modernizr.touch) { + $(window).load(function () { + setTimeout(function () { + window.scrollTo(0, 1); + }, 0); + }); + } + +})(jQuery, this); \ No newline at end of file