Ticket #23449: 23449.14.diff
File 23449.14.diff, 5.9 KB (added by , 11 years ago) |
---|
-
wp-admin/css/wp-admin-rtl.css
2708 2708 font-family: Tahoma, Arial, sans-serif; 2709 2709 } 2710 2710 2711 . accordion-section-title:after {2711 .js .accordion-section-title:after { 2712 2712 right: auto; 2713 2713 left: 20px; 2714 2714 } -
wp-admin/css/wp-admin.css
7490 7490 margin: 0; 7491 7491 } 7492 7492 7493 .accordion-container .accordion-section:first-child { 7493 #nav-menu-meta .accordion-container .top { 7494 border-top: 1px solid #dfdfdf; 7495 } 7496 7497 #nav-menu-meta .accordion-container .accordion-section:first-child, 7498 #nav-menu-meta .accordion-container .accordion-section:first-child h3, 7499 #nav-menu-meta .accordion-container .top, 7500 #nav-menu-meta .accordion-container .top h3 { 7494 7501 -webkit-border-top-right-radius: 3px; 7495 7502 -webkit-border-top-left-radius: 3px; 7496 7503 border-top-right-radius: 3px; 7497 7504 border-top-left-radius: 3px; 7498 7505 } 7499 7506 7500 .accordion-container .accordion-section:last-child { 7507 #nav-menu-meta .accordion-container .accordion-section:last-child, 7508 #nav-menu-meta .accordion-container .accordion-section:last-child .accordion-section-content, 7509 #nav-menu-meta .accordion-container .bottom, 7510 #nav-menu-meta .accordion-container .bottom:not(.open) h3 { 7501 7511 -webkit-border-bottom-right-radius: 3px; 7502 7512 -webkit-border-bottom-left-radius: 3px; 7503 7513 border-bottom-right-radius: 3px; … … 8965 8975 user-select: none; 8966 8976 } 8967 8977 8968 . accordion-section-title:after {8978 .js .accordion-section-title:after { 8969 8979 content: ''; 8970 8980 width: 0; 8971 8981 height: 0; -
wp-admin/includes/template.php
985 985 function do_accordion_sections( $screen, $context, $object ) { 986 986 global $wp_meta_boxes; 987 987 988 wp_enqueue_script( 'accordion' ); 989 988 990 if ( empty( $screen ) ) 989 991 $screen = get_current_screen(); 990 992 elseif ( is_string( $screen ) ) -
wp-admin/js/accordion.js
1 jQuery(document).ready( function($) { 2 // Expand/Collapse 3 $('.accordion-container').on( 'click keydown', '.accordion-section-title', function(e) { 4 if ( e.type === 'keydown' && 13 !== e.which ) // "return" key 5 return; 6 e.preventDefault(); // Keep this AFTER the key filter above 1 ( function( $ ){ 7 2 8 var section = $( this ).closest( '.accordion-section' ), 9 siblings = section.siblings( '.open' ), 10 content = section.find( '.accordion-section-content' ); 3 $( document ).ready( function () { 11 4 12 if ( section.hasClass('cannot-expand') ) 5 // Expand/Collapse on click 6 $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) { 7 if ( e.type === 'keydown' && 13 !== e.which ) // "return" key 8 return; 9 e.preventDefault(); // Keep this AFTER the key filter above 10 11 accordionSwitch( $( this ) ); 12 accordionCorners(); 13 }); 14 15 // Refresh selected accordion option when screen options are toggled 16 $( '.hide-postbox-tog' ).click( function () { 17 accordionInit(); 18 }); 19 20 }); 21 22 var accordionOptions = $( '.accordion-container li.accordion-section' ), 23 sectionContent = $( '.accordion-section-content' ); 24 25 // Rounded corners 26 function accordionCorners () { 27 accordionOptions.removeClass( 'top bottom' ); 28 accordionOptions.filter( ':visible' ).first().addClass( 'top' ); 29 accordionOptions.filter( ':visible' ).last().addClass( 'bottom' ).find( sectionContent ).addClass('bottom'); 30 }; 31 32 function accordionInit () { 33 accordionSwitch( accordionOptions.filter( ':visible' ).first() ); 34 accordionCorners(); 35 } 36 37 function accordionSwitch ( el ) { 38 var section = el.closest( '.accordion-section' ), 39 siblings = section.parent().find( '.open' ), 40 content = section.find( sectionContent ); 41 42 if ( section.hasClass( 'cannot-expand' ) ) 13 43 return; 14 44 15 45 siblings.removeClass( 'open' ); 16 siblings.find( '.accordion-section-content').show().slideUp( 150 );46 siblings.find( sectionContent ).show().slideUp( 150 ); 17 47 content.toggle( section.hasClass( 'open' ) ).slideToggle( 150 ); 18 48 section.toggleClass( 'open' ); 19 }); 20 }); 49 } 50 51 // Show the first accordion option by default 52 accordionInit(); 53 54 })(jQuery); -
wp-admin/js/nav-menu.js
53 53 this.initAccessibility(); 54 54 55 55 this.initToggles(); 56 57 // Open first accordion option58 this.initAccordion();59 56 }, 60 57 61 58 jQueryExtensions : function() { … … 267 264 }); 268 265 }, 269 266 270 initAccordion : function() {271 var accordionOptions = $( '.accordion-container li.accordion-section' );272 accordionOptions.removeClass('open');273 accordionOptions.filter(':visible').first().addClass( 'open' );274 },275 276 267 countMenuItems : function( depth ) { 277 268 return $( '.menu-item-depth-' + depth ).length; 278 269 }, … … 544 535 api.menuList.hideAdvancedMenuItemFields(); 545 536 546 537 $('.hide-postbox-tog').click(function () { 547 api.initAccordion();548 549 538 var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(','); 550 539 $.post(ajaxurl, { 551 540 action: 'closed-postboxes', -
wp-admin/nav-menus.php
23 23 wp_die( __( 'Cheatin’ uh?' ) ); 24 24 25 25 wp_enqueue_script( 'nav-menu' ); 26 wp_enqueue_script( 'accordion' );27 26 28 27 if ( wp_is_mobile() ) 29 28 wp_enqueue_script( 'jquery-touch-punch' );