Changeset 39183
- Timestamp:
- 11/09/2016 04:12:35 PM (9 years ago)
- Location:
- trunk/src/wp-content/themes/twentyseventeen
- Files:
-
- 2 edited
-
assets/js/global.js (modified) (1 diff)
-
functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js
r39081 r39183 28 28 29 29 /** 30 * Ensure the sticky navigation doesn't cover current focused links 31 */ 32 $( '#content a, #colophon a' ).focus( function() { 33 if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { 34 var windowScrollTop = $( window ).scrollTop(), 35 fixedNavHeight = $navigation.height(), 36 itemScrollTop = $( this ).offset().top, 37 offsetDiff = itemScrollTop - windowScrollTop; 38 39 // Account for Admin bar. 40 if ( $( '#wpadminbar' ).length ) { 41 offsetDiff -= $( '#wpadminbar' ).height(); 42 } 43 44 if ( offsetDiff < fixedNavHeight ) { 45 $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 600); 46 }; 47 } 48 } ); 49 50 /** 30 51 * Sets properties of navigation 31 52 */ -
trunk/src/wp-content/themes/twentyseventeen/functions.php
r39073 r39183 380 380 wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '1.0', true ); 381 381 382 wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.2', true ); 383 382 384 wp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); 383 385 384 386 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 385 387 wp_enqueue_script( 'comment-reply' ); 386 }387 388 // Scroll effects (only loaded on front page).389 if ( is_front_page() ) {390 wp_enqueue_script( 'jquery-scrollto', get_template_directory_uri() . '/assets/js/jquery.scrollTo.js', array( 'jquery' ), '2.1.2', true );391 388 } 392 389 }
Note: See TracChangeset
for help on using the changeset viewer.