Changeset 41679
- Timestamp:
- 10/02/2017 06:54:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r41670 r41679 1316 1316 content = meta.find( '.customize-section-description:first' ); 1317 1317 content.toggleClass( 'open' ); 1318 content.slideToggle(); 1318 content.slideToggle( section.defaultExpandedArguments.duration, function() { 1319 content.trigger( 'toggled' ); 1320 } ); 1319 1321 $( this ).attr( 'aria-expanded', function( i, attr ) { 1320 1322 return 'true' === attr ? 'false' : 'true'; … … 2559 2561 if ( meta.hasClass( 'open' ) ) { 2560 2562 meta.toggleClass( 'open' ); 2561 content.slideUp( panel.defaultExpandedArguments.duration ); 2563 content.slideUp( panel.defaultExpandedArguments.duration, function() { 2564 content.trigger( 'toggled' ); 2565 } ); 2562 2566 $( this ).attr( 'aria-expanded', false ); 2563 2567 } else { 2564 content.slideDown( panel.defaultExpandedArguments.duration ); 2568 content.slideDown( panel.defaultExpandedArguments.duration, function() { 2569 content.trigger( 'toggled' ); 2570 } ); 2565 2571 meta.toggleClass( 'open' ); 2566 2572 $( this ).attr( 'aria-expanded', true ); … … 6412 6418 if ( section.hasClass( 'open' ) ) { 6413 6419 section.toggleClass( 'open' ); 6414 content.slideUp( api.Panel.prototype.defaultExpandedArguments.duration ); 6420 content.slideUp( api.Panel.prototype.defaultExpandedArguments.duration, function() { 6421 content.trigger( 'toggled' ); 6422 } ); 6415 6423 $( this ).attr( 'aria-expanded', false ); 6416 6424 } else { 6417 content.slideDown( api.Panel.prototype.defaultExpandedArguments.duration ); 6425 content.slideDown( api.Panel.prototype.defaultExpandedArguments.duration, function() { 6426 content.trigger( 'toggled' ); 6427 } ); 6418 6428 section.toggleClass( 'open' ); 6419 6429 $( this ).attr( 'aria-expanded', true ); … … 7366 7376 (function initStickyHeaders() { 7367 7377 var parentContainer = $( '.wp-full-overlay-sidebar-content' ), 7368 changeContainer, getHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader,7378 changeContainer, updateHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader, 7369 7379 activeHeader, lastScrollTop; 7370 7380 … … 7384 7394 headerElement; 7385 7395 7386 // Release previously active header element.7387 7396 if ( activeHeader && activeHeader.element ) { 7397 // Release previously active header element. 7388 7398 releaseStickyHeader( activeHeader.element ); 7399 7400 // Remove event listener in the previous panel or section. 7401 activeHeader.element.find( '.description' ).off( 'toggled', updateHeaderHeight ); 7389 7402 } 7390 7403 … … 7406 7419 element: headerElement, 7407 7420 parent: headerElement.closest( '.customize-pane-child' ), 7408 height: getHeaderHeight( headerElement)7421 height: headerElement.outerHeight() 7409 7422 }; 7423 7424 // Update header height whenever help text is expanded or collapsed. 7425 activeHeader.element.find( '.description' ).on( 'toggled', updateHeaderHeight ); 7426 7410 7427 if ( expandedSection ) { 7411 7428 resetStickyHeader( activeHeader.element, activeHeader.parent ); … … 7476 7493 7477 7494 /** 7478 * Getheader height.7495 * Update active header height. 7479 7496 * 7480 7497 * @since 4.7.0 7481 7498 * @access private 7482 7499 * 7483 * @param {jQuery} headerElement Header element. 7484 * @returns {number} Height. 7500 * @returns {void} 7485 7501 */ 7486 getHeaderHeight = function( headerElement ) { 7487 var height = headerElement.data( 'height' ); 7488 if ( ! height ) { 7489 height = headerElement.outerHeight(); 7490 headerElement.data( 'height', height ); 7491 } 7492 return height; 7502 updateHeaderHeight = function() { 7503 activeHeader.height = activeHeader.element.outerHeight(); 7493 7504 }; 7494 7505 … … 7946 7957 section.container.find( '.section-meta .customize-section-description:first' ) 7947 7958 .addClass( 'open' ) 7948 .show(); 7959 .show() 7960 .trigger( 'toggled' ); 7949 7961 7950 7962 section.container.find( '.customize-help-toggle' ).attr( 'aria-expanded', 'true' );
Note: See TracChangeset
for help on using the changeset viewer.