Changeset 30838
- Timestamp:
- 12/12/2014 11:58:06 PM (11 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfifteen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r30832 r30838 227 227 } 228 228 229 wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141 010', true );229 wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true ); 230 230 wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array( 231 231 'expand' => '<span class="screen-reader-text">' . esc_html__( 'expand child menu', 'twentyfifteen' ) . '</span>', -
trunk/src/wp-content/themes/twentyfifteen/js/functions.js
r30808 r30838 67 67 var windowPos = $window.scrollTop(); 68 68 69 if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < bodyHeight ) { 70 if ( sidebarHeight + adminbarOffset > windowHeight ) { 71 if ( windowPos > lastWindowPos ) { 72 if ( top ) { 73 top = false; 74 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0; 75 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' ); 76 } else if ( ! bottom && windowPos + windowHeight > sidebarHeight + $sidebar.offset().top ) { 77 bottom = true; 78 $sidebar.attr( 'style', 'position: fixed;bottom: 0;' ); 79 } 80 } else if ( windowPos < lastWindowPos ) { 81 if ( bottom ) { 82 bottom = false; 83 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0; 84 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' ); 85 } else if ( ! top && windowPos + adminbarOffset < $sidebar.offset().top ) { 86 top = true; 87 $sidebar.attr( 'style', 'position: fixed;' ); 88 } 89 } else { 90 top = bottom = false; 69 if ( 955 > windowWidth ) { 70 return; 71 } 72 73 if ( sidebarHeight + adminbarOffset > windowHeight ) { 74 if ( windowPos > lastWindowPos ) { 75 if ( top ) { 76 top = false; 91 77 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0; 92 78 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' ); 79 } else if ( ! bottom && windowPos + windowHeight > sidebarHeight + $sidebar.offset().top && sidebarHeight + adminbarOffset < bodyHeight ) { 80 bottom = true; 81 $sidebar.attr( 'style', 'position: fixed; bottom: 0;' ); 93 82 } 94 } else if ( ! top ) { 95 top = true; 96 $sidebar.attr( 'style', 'position: fixed;' ); 83 } else if ( windowPos < lastWindowPos ) { 84 if ( bottom ) { 85 bottom = false; 86 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0; 87 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' ); 88 } else if ( ! top && windowPos + adminbarOffset < $sidebar.offset().top ) { 89 top = true; 90 $sidebar.attr( 'style', 'position: fixed;' ); 91 } 92 } else { 93 top = bottom = false; 94 topOffset = ( $sidebar.offset().top > 0 ) ? $sidebar.offset().top - adminbarOffset : 0; 95 $sidebar.attr( 'style', 'top: ' + topOffset + 'px;' ); 97 96 } 97 } else if ( ! top ) { 98 top = true; 99 $sidebar.attr( 'style', 'position: fixed;' ); 98 100 } 99 101
Note: See TracChangeset
for help on using the changeset viewer.