From 31187313389ff05cbaf5690453fb933d133a529d Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 3 May 2013 18:22:57 +0000 Subject: [PATCH] Twenty Thirteen: remove fixed navbar. Closes #24184. git-svn-id: https://develop.svn.wordpress.org/trunk@24169 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentythirteen/header.php | 12 ++--- .../themes/twentythirteen/js/functions.js | 40 ---------------- wp-content/themes/twentythirteen/style.css | 46 ------------------- 3 files changed, 3 insertions(+), 95 deletions(-) diff --git a/wp-content/themes/twentythirteen/header.php b/wp-content/themes/twentythirteen/header.php index 12c47fe6f7..e109f2f0ce 100644 --- a/wp-content/themes/twentythirteen/header.php +++ b/wp-content/themes/twentythirteen/header.php @@ -8,21 +8,15 @@ * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ - -/* - * Add class to allow styling for toolbar. - */ -$html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : ''; - ?> -> +> diff --git a/wp-content/themes/twentythirteen/js/functions.js b/wp-content/themes/twentythirteen/js/functions.js index e96877c184..87b42b2bd5 100644 --- a/wp-content/themes/twentythirteen/js/functions.js +++ b/wp-content/themes/twentythirteen/js/functions.js @@ -7,13 +7,8 @@ ( function( $ ) { var html = $( 'html' ), body = $( 'body' ), - navbar = $( '#navbar' ), _window = $( window ), - toolbarOffset = body.is( '.admin-bar' ) ? 28 : 0, - navbarOffset = navbar.offset().top - toolbarOffset, - scrollOffsetMethod = ( typeof window.scrollY === 'undefined' ), adjustFooter, - adjustAnchor; /** * Adds a top margin to the footer if the sidebar widget area is @@ -29,45 +24,10 @@ $( '#colophon' ).css( 'margin-top', margin + 'px' ); }; - /** - * Repositions the window on jump-to-anchor to account for navbar - * height. - */ - adjustAnchor = function() { - if ( window.location.hash ) - window.scrollBy( 0, -49 ); - }; - $( function() { - adjustAnchor(); - if ( body.is( '.sidebar' ) ) adjustFooter(); } ); - _window.on( 'hashchange.twentythirteen', adjustAnchor ); - - /** - * Displays the fixed navbar based on screen position. - */ - if ( _window.innerWidth() > 644 ) { - _window.on( 'scroll.twentythirteen', function() { - var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY; - - if ( scrollOffset > navbarOffset ) - html.addClass( 'navbar-fixed' ); - else - html.removeClass( 'navbar-fixed' ); - } ); - } - - /** - * Allows clicking the navbar to scroll to top. - */ - navbar.on( 'click.twentythirteen', function( event ) { - // Ensure that the navbar element was the target of the click. - if ( 'navbar' == event.target.id || 'site-navigation' == event.target.id ) - $( 'html, body' ).animate( { scrollTop: 0 }, 'fast' ); - } ); /** * Enables menu toggle for small screens. diff --git a/wp-content/themes/twentythirteen/style.css b/wp-content/themes/twentythirteen/style.css index 2b7f7e0c03..9ea04747ee 100644 --- a/wp-content/themes/twentythirteen/style.css +++ b/wp-content/themes/twentythirteen/style.css @@ -966,51 +966,6 @@ ul.nav-menu li:hover > ul, width: 230px; } -/* Fixed Navbar */ -.navbar-fixed { - margin-top: 45px; -} - -.wp-toolbar.navbar-fixed { - margin-top: 73px !important; -} - -.navbar-fixed .site-title { - font-size: 22px; - font-weight: bold; - line-height: 2; - max-width: 400px; - overflow: hidden; - padding: 0; - position: fixed; - text-overflow: ellipsis; - top: 0; - white-space: nowrap; - z-index: 3; -} - -.navbar-fixed .site-title { - color: #141412; -} - -.navbar-fixed .navbar { - box-shadow: 0 2px 2px rgba(173, 165, 105, 0.2); - height: 45px; - position: fixed; - top: 0; - z-index: 2; -} - -.wp-toolbar.navbar-fixed .site-title, -.wp-toolbar.navbar-fixed .navbar { - top: 28px; -} - -.navbar-fixed .menu-toggle, -.navbar-fixed .nav-menu { - display: none; -} - /** * 5.0 Content @@ -3253,7 +3208,6 @@ footer.entry-meta { .widget-area, .main-navigation, .navbar, - .navbar-fixed .site-title, .more-link { display: none; }