Make WordPress Core

Ticket #30366: 30366.4.1.patch

File 30366.4.1.patch, 7.1 KB (added by honeysilvas, 10 years ago)

Corrected patch.

  • src/wp-content/themes/twentyfifteen/footer.php

     
    1212
    1313        </div><!-- .site-content -->
    1414
    15         <footer id="colophon" class="site-footer" role="contentinfo">
    16                 <div class="site-info">
    17                         <?php
    18                                 /**
    19                                  * Fires before the Twenty Fifteen footer text for footer customization.
    20                                  *
    21                                  * @since Twenty Fifteen 1.0
    22                                  */
    23                                 do_action( 'twentyfifteen_credits' );
    24                         ?>
    25                         <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
    26                 </div><!-- .site-info -->
    27         </footer><!-- .site-footer -->
     15                <footer id="colophon" class="site-footer" role="contentinfo">
     16                        <div class="site-info">
     17                                <?php
     18                                        /**
     19                                         * Fires before the Twenty Fifteen footer text for footer customization.
     20                                         *
     21                                         * @since Twenty Fifteen 1.0
     22                                         */
     23                                        do_action( 'twentyfifteen_credits' );
     24                                ?>
     25                                <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
     26                        </div><!-- .site-info -->
     27                </footer><!-- .site-footer -->
     28        </div><!-- .main-wrapper -->
    2829
    2930</div><!-- .site -->
    3031
  • src/wp-content/themes/twentyfifteen/header.php

     
    4747
    4848                <?php get_sidebar(); ?>
    4949        </div><!-- .sidebar -->
    50 
    51         <div id="content" class="site-content">
     50       
     51        <div id="main-wrapper" class="main-wrapper">
     52                <div id="content" class="site-content">
     53 No newline at end of file
  • src/wp-content/themes/twentyfifteen/js/functions.js

     
    66 */
    77
    88( function( $ ) {
    9         var $body, $window, $document, $sidebar, adminbarOffset, top = false,
     9        var $body, $window, $document, $mainWrapper, $sidebar, adminbarOffset, top = false,
    1010                bottom = false, windowWidth, windowHeight, lastWindowPos = 0,
    11                 topOffset = 0, documentHeight, sidebarWidth, sidebarHeight, resizeTimer;
     11                topOffset = 0, documentHeight, mainWrapperHeight, sidebarWidth, sidebarHeight, resizeTimer;
    1212
    1313        // Add dropdown toggle that display child menu items.
    1414        $( '.main-navigation .page_item_has_children > a, .main-navigation .menu-item-has-children > a' ).after( '<button class="dropdown-toggle" aria-expanded="false">' + screenReaderText.expand + '</button>' );
     
    5555                windowWidth = $window.width();
    5656                windowHeight = $window.height();
    5757                documentHeight = $document.height();
     58                mainWrapperHeight = $mainWrapper.height();
    5859                sidebarHeight = $sidebar.height();
    5960
    6061                if ( 955 >= windowWidth ) {
    6162                        top = bottom = false;
    6263                        $sidebar.removeAttr( 'style' );
     64                        $mainWrapper.removeAttr( 'style' );
    6365                }
    6466        }
    65 
     67       
    6668        function scroll() {
    67                 var windowPos = $window.scrollTop();
    68 
    69                 if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < documentHeight ) {
    70                         if ( sidebarHeight + adminbarOffset > windowHeight ) {
     69                var windowPos, $pane, paneHeight;
     70                windowPos = $window.scrollTop();
     71                $pane = ( sidebarHeight > mainWrapperHeight ) ? $mainWrapper : $sidebar;
     72                paneHeight = $pane.height();   
     73               
     74                if ( 955 <= windowWidth && paneHeight + adminbarOffset < documentHeight ) {
     75                        if ( paneHeight + adminbarOffset > windowHeight ) {
    7176                                if ( windowPos > lastWindowPos ) {
    7277                                        if ( top ) {
    7378                                                top = false;
    74                                                 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0;
    75                                                 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' );
    76                                         } else if ( ! bottom && windowPos + windowHeight > sidebarHeight + $sidebar.offset().top ) {
     79                                                topOffset = ( $pane.offset().top > 0 ) ? $pane.offset().top - adminbarOffset : 0;
     80                                                $pane.attr( 'style', 'top: ' + topOffset + 'px;' );
     81                                        } else if ( ! bottom && windowPos + windowHeight > paneHeight + $pane.offset().top ) {
    7782                                                bottom = true;
    78                                                 $sidebar.attr( 'style', 'position: fixed;bottom: 0;' );
     83                                                $pane.attr( 'style', 'position: fixed;bottom: 0;' );
    7984                                        }
    8085                                } else if ( windowPos < lastWindowPos ) {
    8186                                        if ( bottom ) {
    8287                                                bottom = false;
    83                                                 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0;
    84                                                 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' );
    85                                         } else if ( ! top && windowPos + adminbarOffset < $sidebar.offset().top ) {
     88                                                topOffset = ( $pane.offset().top > 0 ) ? $pane.offset().top - adminbarOffset : 0;
     89                                                $pane.attr( 'style', 'top: ' + topOffset + 'px;' );
     90                                        } else if ( ! top && windowPos + adminbarOffset < $pane.offset().top ) {
    8691                                                top = true;
    87                                                 $sidebar.attr( 'style', 'position: fixed;' );
     92                                                $pane.attr( 'style', 'position: fixed;' );
    8893                                        }
    8994                                } else {
    9095                                        top = bottom = false;
    91                                         topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0;
    92                                         $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' );
     96                                        topOffset = ( $pane.offset().top > 0 ) ? $pane.offset().top - adminbarOffset : 0;
     97                                        $pane.attr( 'style', 'top: ' + topOffset + 'px;' );
    9398                                }
    9499                        } else if ( ! top ) {
    95100                                top = true;
    96                                 $sidebar.attr( 'style', 'position: fixed;' );
     101                                $pane.attr( 'style', 'position: fixed;' );
    97102                        }
    98103                }
    99104
     
    109114                $body          = $( 'body' );
    110115                $window        = $( window );
    111116                $document      = $( document );
    112                 $sidebar        = $( '#sidebar' ).first();
     117                $mainWrapper   = $( '#main-wrapper' ).first();
     118                $sidebar       = $( '#sidebar' ).first();
    113119                adminbarOffset = $body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0;
    114 
     120               
    115121                $window
    116122                        .on( 'scroll.twentyfifteen', scroll )
    117123                        .on( 'resize.twentyfifteen', function() {
  • src/wp-content/themes/twentyfifteen/style.css

     
    12711271.comment-content:after,
    12721272.site-content:before,
    12731273.site-content:after,
     1274.main-wrapper:before,
     1275.main-wrapper:after,
    12741276.nav-links:before,
    12751277.nav-links:after,
    12761278.comment-navigation:before,
     
    12881290.entry-content:after,
    12891291.comment-content:after,
    12901292.site-content:after,
     1293.main-wrapper:after,
    12911294.nav-links:after,
    12921295.comment-navigation:after,
    12931296.social-navigation ul:after,
     
    39673970                padding: 8.3333% 0;
    39683971        }
    39693972
    3970         .site-content {
     3973        .main-wrapper {
    39713974                display: block;
    39723975                float: left;
    39733976                margin-left: 29.4118%;
    39743977                width: 70.5882%;
     3978                position: relative;
     3979                margin-bottom: 1.6em;
     3980                z-index: 10;
    39753981        }
    39763982
    39773983        body {
     
    45624568        }
    45634569
    45644570        .site-footer {
    4565                 float: left;
    4566                 margin: 0 0 0 35.2941%;
     4571                display: block;
    45674572                padding: 0;
    4568                 width: 58.8235%;
    45694573        }
    45704574
    45714575        .site-info {