Changeset 40395
- Timestamp:
- 04/07/2017 07:26:31 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-controls.css
r40312 r40395 302 302 -webkit-transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1), 0.18s -webkit-transform cubic-bezier(0.645, 0.045, 0.355, 1); 303 303 transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1), 0.18s -webkit-transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */ 304 } 305 306 #customize-theme-controls .customize-pane-child.skip-transition { 307 -webkit-transition: none; 308 transition: none; 304 309 } 305 310 -
trunk/src/wp-admin/js/customize-controls.js
r40380 r40395 712 712 content = construct.contentContainer, 713 713 overlay = content.closest( '.wp-full-overlay' ), 714 elements, transitionEndCallback ;714 elements, transitionEndCallback, transitionParentPane; 715 715 716 716 // Determine set of elements that are affected by the animation. 717 717 elements = overlay.add( content ); 718 if ( _.isUndefined( construct.panel ) || '' === construct.panel() ) { 718 719 if ( ! construct.panel || '' === construct.panel() ) { 720 transitionParentPane = true; 721 } else if ( api.panel( construct.panel() ).contentContainer.hasClass( 'skip-transition' ) ) { 722 transitionParentPane = true; 723 } else { 724 transitionParentPane = false; 725 } 726 if ( transitionParentPane ) { 719 727 elements = elements.add( '#customize-info, .customize-pane-parent' ); 720 728 } … … 997 1005 backBtn = content.find( '.customize-section-back' ), 998 1006 sectionTitle = section.headContainer.find( '.accordion-section-title' ).first(), 999 expand ;1007 expand, panel; 1000 1008 1001 1009 if ( expanded && ! content.hasClass( 'open' ) ) { … … 1045 1053 1046 1054 } else if ( ! expanded && content.hasClass( 'open' ) ) { 1055 if ( section.panel() ) { 1056 panel = api.panel( section.panel() ); 1057 if ( panel.contentContainer.hasClass( 'skip-transition' ) ) { 1058 panel.collapse(); 1059 } 1060 } 1047 1061 section._animateChangeExpanded( function() { 1048 1062 backBtn.attr( 'tabindex', '-1' ); … … 1723 1737 container = accordionSection.closest( '.wp-full-overlay-sidebar-content' ), 1724 1738 topPanel = panel.headContainer.find( '.accordion-section-title' ), 1725 backBtn = accordionSection.find( '.customize-panel-back' ); 1739 backBtn = accordionSection.find( '.customize-panel-back' ), 1740 childSections = panel.sections(), 1741 skipTransition; 1726 1742 1727 1743 if ( expanded && ! accordionSection.hasClass( 'current-panel' ) ) { … … 1738 1754 }); 1739 1755 1740 panel._animateChangeExpanded( function() { 1741 topPanel.attr( 'tabindex', '-1' ); 1742 backBtn.attr( 'tabindex', '0' ); 1743 1744 backBtn.focus(); 1745 accordionSection.css( 'top', '' ); 1746 container.scrollTop( 0 ); 1747 1748 if ( args.completeCallback ) { 1749 args.completeCallback(); 1750 } 1751 } ); 1752 1753 overlay.addClass( 'in-sub-panel' ); 1754 accordionSection.addClass( 'current-panel' ); 1756 if ( panel.params.autoExpandSoleSection && 1 === childSections.length && childSections[0].active.get() ) { 1757 accordionSection.addClass( 'current-panel skip-transition' ); 1758 overlay.addClass( 'in-sub-panel' ); 1759 1760 childSections[0].expand( { 1761 completeCallback: args.completeCallback 1762 } ); 1763 } else { 1764 panel._animateChangeExpanded( function() { 1765 topPanel.attr( 'tabindex', '-1' ); 1766 backBtn.attr( 'tabindex', '0' ); 1767 1768 backBtn.focus(); 1769 accordionSection.css( 'top', '' ); 1770 container.scrollTop( 0 ); 1771 1772 if ( args.completeCallback ) { 1773 args.completeCallback(); 1774 } 1775 } ); 1776 1777 accordionSection.addClass( 'current-panel' ); 1778 overlay.addClass( 'in-sub-panel' ); 1779 } 1780 1755 1781 api.state( 'expandedPanel' ).set( panel ); 1756 1782 1757 1783 } else if ( ! expanded && accordionSection.hasClass( 'current-panel' ) ) { 1758 panel._animateChangeExpanded( function() { 1759 topPanel.attr( 'tabindex', '0' ); 1760 backBtn.attr( 'tabindex', '-1' ); 1761 1762 topPanel.focus(); 1763 accordionSection.css( 'top', '' ); 1764 1765 if ( args.completeCallback ) { 1766 args.completeCallback(); 1767 } 1768 } ); 1784 skipTransition = accordionSection.hasClass( 'skip-transition' ); 1785 if ( ! skipTransition ) { 1786 panel._animateChangeExpanded( function() { 1787 topPanel.attr( 'tabindex', '0' ); 1788 backBtn.attr( 'tabindex', '-1' ); 1789 1790 topPanel.focus(); 1791 accordionSection.css( 'top', '' ); 1792 1793 if ( args.completeCallback ) { 1794 args.completeCallback(); 1795 } 1796 } ); 1797 } else { 1798 accordionSection.removeClass( 'skip-transition' ); 1799 } 1769 1800 1770 1801 overlay.removeClass( 'in-sub-panel' ); -
trunk/src/wp-includes/class-wp-customize-panel.php
r38470 r40395 105 105 106 106 /** 107 * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section. 108 * 109 * @since 4.7.4 110 * @access public 111 * @var bool 112 */ 113 public $auto_expand_sole_section = false; 114 115 /** 107 116 * Customizer sections for this panel. 108 117 * … … 220 229 $array['active'] = $this->active(); 221 230 $array['instanceNumber'] = $this->instance_number; 231 $array['autoExpandSoleSection'] = $this->auto_expand_sole_section; 222 232 return $array; 223 233 } -
trunk/src/wp-includes/class-wp-customize-widgets.php
r40330 r40395 423 423 'priority' => 110, 424 424 'active_callback' => array( $this, 'is_panel_active' ), 425 'auto_expand_sole_section' => true, 425 426 ) ); 426 427
Note: See TracChangeset
for help on using the changeset viewer.