Changeset 33610
- Timestamp:
- 08/11/2015 11:55:40 PM (9 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-nav-menus.css
r33604 r33610 444 444 .reordering .menu-item-depth-11 > .menu-item-bar { margin-right: 165px; } 445 445 446 /* Forces top margin to be zero for new menu */447 .control-section-nav_menu.open .menu {448 margin-top: 0 !important;449 }450 451 446 .control-section-nav_menu .menu .menu-item-edit-active { 452 447 margin-left: 0; -
trunk/src/wp-admin/js/customize-controls.js
r33599 r33610 69 69 focus = function () { 70 70 var focusContainer; 71 if ( construct.ex tended( api.Panel )&& construct.expanded() ) {72 focusContainer = construct.container.find( ' .control-panel-content:first' );71 if ( construct.expanded && construct.expanded() ) { 72 focusContainer = construct.container.find( 'ul:first' ); 73 73 } else { 74 74 focusContainer = construct.container; … … 582 582 */ 583 583 onChangeExpanded: function ( expanded, args ) { 584 var position, scroll,section = this,584 var section = this, 585 585 container = section.container.closest( '.wp-full-overlay-sidebar-content' ), 586 586 content = section.container.find( '.accordion-section-content' ), … … 588 588 backBtn = section.container.find( '.customize-section-back' ), 589 589 sectionTitle = section.container.find( '.accordion-section-title' ).first(), 590 expand; 590 headerActionsHeight = $( '#customize-header-actions' ).height(), 591 resizeContentHeight, expand, position, scroll; 591 592 592 593 if ( expanded && ! section.container.hasClass( 'open' ) ) { … … 596 597 } else { 597 598 container.scrollTop( 0 ); 598 expand = function() {599 resizeContentHeight = function() { 599 600 var matchMedia, offset; 600 601 matchMedia = window.matchMedia || window.msMatchMedia; … … 605 606 offset = 45; 606 607 } 607 608 content.css( 'height', ( window.innerHeight - offset ) ); 609 }; 610 expand = function() { 608 611 section.container.addClass( 'open' ); 609 612 overlay.addClass( 'section-open' ); 610 613 position = content.offset().top; 611 614 scroll = container.scrollTop(); 612 content.css( 'margin-top', ( 45- position - scroll ) );613 content.css( 'height', ( window.innerHeight - offset ));615 content.css( 'margin-top', ( headerActionsHeight - position - scroll ) ); 616 resizeContentHeight(); 614 617 sectionTitle.attr( 'tabindex', '-1' ); 615 618 backBtn.attr( 'tabindex', '0' ); … … 618 621 args.completeCallback(); 619 622 } 623 624 // Fix the height after browser resize. 625 $( window ).on( 'resize.customizer-section', _.debounce( resizeContentHeight, 100 ) ); 626 627 // Fix the top margin after reflow. 628 api.bind( 'pane-contents-reflowed', _.debounce( function() { 629 var offset = ( content.offset().top - headerActionsHeight ); 630 if ( 0 < offset ) { 631 content.css( 'margin-top', ( parseInt( content.css( 'margin-top' ), 10 ) - offset ) ); 632 } 633 }, 100 ) ); 620 634 }; 621 635 } … … 641 655 section.container.removeClass( 'open' ); 642 656 overlay.removeClass( 'section-open' ); 643 content.css( 'margin-top', ' inherit' );657 content.css( 'margin-top', '' ); 644 658 container.scrollTop( 0 ); 645 659 backBtn.attr( 'tabindex', '-1' ); … … 649 663 args.completeCallback(); 650 664 } 665 $( window ).off( 'resize.customizer-section' ); 651 666 } else { 652 667 if ( args.completeCallback ) { … … 1236 1251 backBtn = section.find( '.customize-panel-back' ), 1237 1252 panelTitle = section.find( '.accordion-section-title' ).first(), 1238 content = section.find( '.control-panel-content' ); 1253 content = section.find( '.control-panel-content' ), 1254 headerActionsHeight = $( '#customize-header-actions' ).height(); 1239 1255 1240 1256 if ( expanded ) { … … 1256 1272 position = content.offset().top; 1257 1273 scroll = container.scrollTop(); 1258 content.css( 'margin-top', ( $( '#customize-header-actions' ).height()- position - scroll ) );1274 content.css( 'margin-top', ( headerActionsHeight - position - scroll ) ); 1259 1275 section.addClass( 'current-panel' ); 1260 1276 overlay.addClass( 'in-sub-panel' ); … … 1267 1283 backBtn.attr( 'tabindex', '0' ); 1268 1284 backBtn.focus(); 1285 1286 // Fix the top margin after reflow. 1287 api.bind( 'pane-contents-reflowed', _.debounce( function() { 1288 content.css( 'margin-top', ( parseInt( content.css( 'margin-top' ), 10 ) - ( content.offset().top - headerActionsHeight ) ) ); 1289 }, 100 ) ); 1269 1290 } else { 1270 1291 siblings.removeClass( 'open' ); … … 2604 2625 api[ type ].each( function ( construct, id ) { 2605 2626 var active = !! ( activeConstructs && activeConstructs[ id ] ); 2606 construct.active( active ); 2627 if ( active ) { 2628 construct.activate(); 2629 } else { 2630 construct.deactivate(); 2631 } 2607 2632 } ); 2608 2633 } );
Note: See TracChangeset
for help on using the changeset viewer.