Ticket #24184: 24184.diff
| File 24184.diff, 3.2 KB (added by , 13 years ago) |
|---|
-
wp-content/themes/twentythirteen/style.css
965 965 width: 230px; 966 966 } 967 967 968 /* Fixed Navbar */969 .navbar-fixed {970 margin-top: 45px;971 }972 968 973 .wp-toolbar.navbar-fixed {974 margin-top: 73px !important;975 }976 977 .navbar-fixed .site-title {978 font-size: 22px;979 font-weight: bold;980 line-height: 2;981 max-width: 400px;982 overflow: hidden;983 padding: 0;984 position: fixed;985 text-overflow: ellipsis;986 top: 0;987 white-space: nowrap;988 z-index: 3;989 }990 991 .navbar-fixed .site-title {992 color: #141412;993 }994 995 .navbar-fixed .navbar {996 box-shadow: 0 2px 2px rgba(173, 165, 105, 0.2);997 height: 45px;998 position: fixed;999 top: 0;1000 z-index: 2;1001 }1002 1003 .wp-toolbar.navbar-fixed .site-title,1004 .wp-toolbar.navbar-fixed .navbar {1005 top: 28px;1006 }1007 1008 .navbar-fixed .menu-toggle,1009 .navbar-fixed .nav-menu {1010 display: none;1011 }1012 1013 1014 969 /** 1015 970 * 5.0 Content 1016 971 * ---------------------------------------------------------------------------- … … 3255 3210 .widget-area, 3256 3211 .main-navigation, 3257 3212 .navbar, 3258 .navbar-fixed .site-title,3259 3213 .more-link { 3260 3214 display: none; 3261 3215 } -
wp-content/themes/twentythirteen/js/functions.js
7 7 ( function( $ ) { 8 8 var html = $( 'html' ), 9 9 body = $( 'body' ), 10 navbar = $( '#navbar' ),11 10 _window = $( window ), 12 toolbarOffset = body.is( '.admin-bar' ) ? 28 : 0,13 navbarOffset = navbar.offset().top - toolbarOffset,14 scrollOffsetMethod = ( typeof window.scrollY === 'undefined' ),15 11 adjustFooter, 16 adjustAnchor;17 12 18 13 /** 19 14 * Adds a top margin to the footer if the sidebar widget area is … … 29 24 $( '#colophon' ).css( 'margin-top', margin + 'px' ); 30 25 }; 31 26 32 /**33 * Repositions the window on jump-to-anchor to account for navbar34 * height.35 */36 adjustAnchor = function() {37 if ( window.location.hash )38 window.scrollBy( 0, -49 );39 };40 41 27 $( function() { 42 adjustAnchor();43 44 28 if ( body.is( '.sidebar' ) ) 45 29 adjustFooter(); 46 30 } ); 47 _window.on( 'hashchange.twentythirteen', adjustAnchor );48 31 49 32 /** 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 else59 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' );70 } );71 72 /**73 33 * Enables menu toggle for small screens. 74 34 */ 75 35 ( function() {