Make WordPress Core

Ticket #26031: 26031.diff

File 26031.diff, 2.9 KB (added by dougwollison, 12 years ago)

Initial changes: simple spacing fixes

  • src/wp-content/themes/twentyfourteen/js/functions.js

     
    1 ( function( $ ) {
    2         var body    = $( 'body' ),
    3             _window = $( window );
     1(function( $ ) {
     2        var body        = $( 'body' ),
     3                _window = $( window );
    44
    55        // Enable menu toggle for small screens.
    6         ( function() {
     6        (function() {
    77                var nav = $( '#primary-navigation' ), button, menu;
    88                if ( ! nav ) {
    99                        return;
     
    2323
    2424                $( '.menu-toggle' ).on( 'click.twentyfourteen', function() {
    2525                        nav.toggleClass( 'toggled-on' );
    26                 } );
    27         } )();
     26                });
     27        })();
    2828
    2929        /*
    3030         * Makes "skip to content" link work correctly in IE9 and Chrome for better
     
    4242
    4343                        element.focus();
    4444                }
    45         } );
     45        });
    4646
    4747        $( function() {
    4848                // Search toggle.
    4949                $( '.search-toggle' ).on( 'click.twentyfourteen', function() {
    50                         var that    = $( this ),
    51                             wrapper = $( '.search-box-wrapper' );
     50                        var that        = $( this ),
     51                                wrapper = $( '.search-box-wrapper' );
    5252
    5353                        that.toggleClass( 'active' );
    5454                        wrapper.toggleClass( 'hide' );
     
    5656                        if ( that.is( '.active' ) ) {
    5757                                wrapper.find( '.search-field' ).focus();
    5858                        }
    59                 } );
     59                });
    6060
    6161                /*
    6262                 * Fixed header for large screen.
     
    6565                 * The callback on the scroll event is only added if there is a header
    6666                 * image and we are not on mobile.
    6767                 */
    68                  if ( _window.width() > 781 ) {
     68                if ( _window.width() > 781 ) {
    6969                        var mastheadHeight = $( '#masthead' ).height(),
    7070                                toolbarOffset, mastheadOffset;
    7171
     
    8383                                        } else {
    8484                                                body.removeClass( 'masthead-fixed' );
    8585                                        }
    86                                 } );
     86                                });
    8787                        }
    8888                }
    8989
    9090                // Focus styles for menus.
    9191                $( '.primary-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
    9292                        $( this ).parents().toggleClass( 'focus' );
    93                 } );
     93                });
    9494        } );
    9595
    9696        // Arrange footer widgets vertically.
    9797        if ( $.isFunction( $.fn.masonry ) ) {
    98                 $( '#footer-sidebar' ).masonry( {
     98                $( '#footer-sidebar' ).masonry({
    9999                        itemSelector: '.widget',
    100                         columnWidth: function( containerWidth ) {
     100                        columnWidth:  function( containerWidth ) {
    101101                                return containerWidth / 4;
    102102                        },
    103                         gutterWidth: 0,
    104                         isResizable: true,
    105                         isRTL: $( 'body' ).is( '.rtl' )
    106                 } );
     103                        gutterWidth:  0,
     104                        isResizable:  true,
     105                        isRTL:        $( 'body' ).is( '.rtl' )
     106                });
    107107        }
    108108
    109109        // Initialize Featured Content slider.
    110         _window.load( function() {
     110        _window.load(function() {
    111111                if ( body.is( '.slider' ) ) {
    112                         $( '.featured-content' ).featuredslider( {
    113                                 selector:  '.featured-content-inner > article',
     112                        $( '.featured-content' ).featuredslider({
     113                                selector:          '.featured-content-inner > article',
    114114                                controlsContainer: '.featured-content'
    115                         } );
     115                        });
    116116                }
    117         } );
    118 } )( jQuery );
     117        });
     118})( jQuery );