Changeset 39073
- Timestamp:
- 11/01/2016 06:59:06 PM (8 years ago)
- Location:
- trunk/src/wp-content/themes/twentyseventeen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js
r38964 r39073 143 143 $( document ).ready( function() { 144 144 145 // Let's fire some JavaScript! 146 setNavProps(); 147 145 // If navigation menu is present on page, setNavProps and adjustScrollClass 146 if( $navigation.length ) { 147 setNavProps(); 148 adjustScrollClass(); 149 } 150 151 // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event 148 152 if ( $menuScrollDown.length ) { 149 153 150 /**151 * 'Scroll Down' arrow in menu area152 */153 154 if ( $( 'body' ).hasClass( 'admin-bar' ) ) { 154 155 menuTop -= 32; … … 157 158 menuTop -= 30; // The div for latest posts has no space above content, add some to account for this 158 159 } 160 if ( ! $navigation.length ) { 161 navigationOuterHeight = 0; 162 } 163 159 164 $menuScrollDown.click( function( e ) { 160 165 e.preventDefault(); … … 164 169 } ); 165 170 } ); 166 167 adjustScrollClass();168 171 } 169 172 … … 176 179 } ); 177 180 178 if ( 'true' === twentyseventeenScreenReaderText.has_navigation ) { 181 // If navigation menu is present on page, adjust it on scroll and screen resize 182 if ( $navigation.length ) { 179 183 180 184 // On scroll, we want to stick/unstick the navigation … … 188 192 setNavProps(); 189 193 setTimeout( adjustScrollClass, 500 ); 190 setTimeout( adjustHeaderHeight, 1000 );191 194 } ); 192 195 } … … 197 200 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 198 201 }, 300 ); 202 setTimeout( adjustHeaderHeight, 1000 ); 199 203 } ); 200 204 -
trunk/src/wp-content/themes/twentyseventeen/functions.php
r39072 r39073 369 369 $twentyseventeen_l10n = array( 370 370 'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), 371 'has_navigation' => 'false',372 371 ); 373 372 374 373 if ( has_nav_menu( 'top' ) ) { 375 374 wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array(), '1.0', true ); 376 $twentyseventeen_l10n['has_navigation'] = 'true';377 375 $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); 378 376 $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); -
trunk/src/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php
r39072 r39073 17 17 ) ); ?> 18 18 19 <?php if ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page()) ) : ?>19 <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?> 20 20 <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll Down', 'twentyseventeen' ); ?></span></a> 21 21 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.