Changeset 39102
- Timestamp:
- 11/03/2016 01:20:14 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
wp-content/themes/twentyfourteen/js/functions.js (modified) (2 diffs)
-
wp-includes/js/wp-custom-header.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/js/functions.js
r38985 r39102 106 106 if ( body.is( '.header-image' ) ) { 107 107 108 // Recaculate the header height when a custom header loads.109 $( 'body' ).on( 'wp-custom-header-video-loaded', function() {110 mastheadOffset = $( '#site-header' ).height();111 } );112 113 108 _window.on( 'scroll.twentyfourteen', function() { 114 109 if ( _window.scrollTop() > mastheadOffset && mastheadHeight < 49 ) { … … 118 113 } 119 114 } ); 115 116 // Update masthead offset once a custom header video loads. 117 $( document ).on( 'wp-custom-header-video-loaded', function() { 118 mastheadOffset = $( '#site-header' ).height(); 119 } ); 120 120 121 121 122 // Update masthead offset after a selective refresh. -
trunk/src/wp-includes/js/wp-custom-header.js
r39050 r39102 1 (function( window, $,settings ) {1 (function( window, settings ) { 2 2 3 3 if ( ! ( 'addEventListener' in window ) ) { … … 32 32 if ( handlers.hasOwnProperty( id ) && handler.test( settings ) ) { 33 33 handler.callback( settings ); 34 35 // Set up and dispatch custom event when the video is loaded. 36 if ( 'dispatchEvent' in window ) { 37 var videoLoaded = new Event( 'wp-custom-header-video-loaded' ); 38 document.dispatchEvent( videoLoaded ); 39 } 40 34 41 break; 35 42 } 36 43 } 37 38 $( 'body' ).trigger( 'wp-custom-header-video-loaded' );39 44 } 40 45 } … … 152 157 } 153 158 154 })( window, jQuery,window._wpCustomHeaderSettings || {} );159 })( window, window._wpCustomHeaderSettings || {} );
Note:
See TracChangeset
for help on using the changeset viewer.