WordPress.org

Make WordPress Core

Changeset 24169


Ignore:
Timestamp:
05/03/2013 06:22:57 PM (5 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: remove fixed navbar. Closes #24184.

Location:
trunk/wp-content/themes/twentythirteen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/header.php

    r24072 r24169  
    99 * @since Twenty Thirteen 1.0
    1010 */
    11 
    12 /*
    13  * Add class to allow styling for toolbar.
    14  */
    15 $html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
    16 
    1711?><!DOCTYPE html>
    1812<!--[if IE 7]>
    19 <html class="ie ie7 <?php echo $html_class; ?>" <?php language_attributes(); ?>>
     13<html class="ie ie7" <?php language_attributes(); ?>>
    2014<![endif]-->
    2115<!--[if IE 8]>
    22 <html class="ie ie8 <?php echo $html_class; ?>" <?php language_attributes(); ?>>
     16<html class="ie ie8" <?php language_attributes(); ?>>
    2317<![endif]-->
    2418<!--[if !(IE 7) | !(IE 8)  ]><!-->
    25 <html class="<?php echo $html_class; ?>" <?php language_attributes(); ?>>
     19<html <?php language_attributes(); ?>>
    2620<!--<![endif]-->
    2721<head>
  • trunk/wp-content/themes/twentythirteen/js/functions.js

    r24070 r24169  
    88    var html               = $( 'html' ),
    99        body               = $( 'body' ),
    10         navbar             = $( '#navbar' ),
    1110        _window            = $( window ),
    12         toolbarOffset      = body.is( '.admin-bar' ) ? 28 : 0,
    13         navbarOffset       = navbar.offset().top - toolbarOffset,
    14         scrollOffsetMethod = ( typeof window.scrollY === 'undefined' ),
    1511        adjustFooter,
    16         adjustAnchor;
    1712
    1813    /**
     
    3025    };
    3126
    32     /**
    33      * Repositions the window on jump-to-anchor to account for navbar
    34      * height.
    35      */
    36     adjustAnchor = function() {
    37         if ( window.location.hash )
    38             window.scrollBy( 0, -49 );
    39     };
    40 
    4127    $( function() {
    42         adjustAnchor();
    43 
    4428        if ( body.is( '.sidebar' ) )
    4529            adjustFooter();
    46     } );
    47     _window.on( 'hashchange.twentythirteen', adjustAnchor );
    48 
    49     /**
    50      * Displays the fixed navbar based on screen position.
    51      */
    52     if ( _window.innerWidth() > 644 ) {
    53         _window.on( 'scroll.twentythirteen', function() {
    54             var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY;
    55 
    56             if ( scrollOffset > navbarOffset )
    57                 html.addClass( 'navbar-fixed' );
    58             else
    59                 html.removeClass( 'navbar-fixed' );
    60         } );
    61     }
    62 
    63     /**
    64      * Allows clicking the navbar to scroll to top.
    65      */
    66     navbar.on( 'click.twentythirteen', function( event ) {
    67         // Ensure that the navbar element was the target of the click.
    68         if ( 'navbar' == event.target.id  || 'site-navigation' == event.target.id )
    69             $( 'html, body' ).animate( { scrollTop: 0 }, 'fast' );
    7030    } );
    7131
  • trunk/wp-content/themes/twentythirteen/style.css

    r24167 r24169  
    967967}
    968968
    969 /* Fixed Navbar */
    970 .navbar-fixed {
    971     margin-top: 45px;
    972 }
    973 
    974 .wp-toolbar.navbar-fixed {
    975     margin-top: 73px !important;
    976 }
    977 
    978 .navbar-fixed .site-title {
    979     font-size: 22px;
    980     font-weight: bold;
    981     line-height: 2;
    982     max-width: 400px;
    983     overflow: hidden;
    984     padding: 0;
    985     position: fixed;
    986     text-overflow: ellipsis;
    987     top: 0;
    988     white-space: nowrap;
    989     z-index: 3;
    990 }
    991 
    992 .navbar-fixed .site-title {
    993     color: #141412;
    994 }
    995 
    996 .navbar-fixed .navbar {
    997     box-shadow: 0 2px 2px rgba(173, 165, 105, 0.2);
    998     height: 45px;
    999     position: fixed;
    1000     top: 0;
    1001     z-index: 2;
    1002 }
    1003 
    1004 .wp-toolbar.navbar-fixed .site-title,
    1005 .wp-toolbar.navbar-fixed .navbar {
    1006     top: 28px;
    1007 }
    1008 
    1009 .navbar-fixed .menu-toggle,
    1010 .navbar-fixed .nav-menu {
    1011     display: none;
    1012 }
    1013 
    1014969
    1015970/**
     
    32543209    .main-navigation,
    32553210    .navbar,
    3256     .navbar-fixed .site-title,
    32573211    .more-link {
    32583212        display: none;
Note: See TracChangeset for help on using the changeset viewer.