Ticket #23449: 23449.4.diff
File 23449.4.diff, 6.7 KB (added by , 11 years ago) |
---|
-
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
14 14 clicked.toggleClass( 'open' ); 15 15 event.preventDefault(); 16 16 }); 17 }); 18 jQuery(document).ready( function($) { 19 // Expand/Collapse 20 $('.accordion-section-title').on('click keydown', function( event ) { 21 22 if ( event.type === 'keydown' && 13 !== event.which ) // enter 23 return; 24 25 var clicked = $( this ).closest( '.accordion-section' ); 26 27 if ( clicked.hasClass('cannot-expand') ) 28 return; 29 30 clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' ); 31 clicked.toggleClass( 'open' ); 32 event.preventDefault(); 17 // Refresh selected accordion option when screen options are toggled 18 $('.hide-postbox-tog').click(function () { 19 accordion.init(); 33 20 }); 21 // Show the first accordion option by default 22 accordion.init(); 34 23 }); 35 jQuery(document).ready( function($) { 36 // Expand/Collapse 37 $('.accordion-section-title').on('click keydown', function( event ) { 38 39 if ( event.type === 'keydown' && 13 !== event.which ) // enter 40 return; 41 42 var clicked = $( this ).closest( '.accordion-section' ); 43 44 if ( clicked.hasClass('cannot-expand') ) 45 return; 46 47 clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' ); 48 clicked.toggleClass( 'open' ); 49 event.preventDefault(); 50 }); 51 }); 52 No newline at end of file 24 (function($){ 25 accordion = { 26 init : function() { 27 var accordionOptions = $( '.accordion-container li.accordion-section' ); 28 accordionOptions.removeClass('open'); 29 accordionOptions.filter(':visible').first().addClass( 'open' ); 30 } 31 }; 32 })(jQuery); 33 No newline at end of file -
wp-admin/js/nav-menu.js
51 51 this.initAccessibility(); 52 52 53 53 this.initToggles(); 54 55 // Open first accordion option56 this.initAccordion();57 54 }, 58 55 59 56 jQueryExtensions : function() { … … 265 262 }); 266 263 }, 267 264 268 initAccordion : function() {269 var accordionOptions = $( '.accordion-container li.accordion-section' );270 accordionOptions.removeClass('open');271 accordionOptions.filter(':visible').first().addClass( 'open' );272 },273 274 265 countMenuItems : function( depth ) { 275 266 return $( '.menu-item-depth-' + depth ).length; 276 267 }, … … 547 538 api.menuList.hideAdvancedMenuItemFields(); 548 539 549 540 $('.hide-postbox-tog').click(function () { 550 api.initAccordion();551 552 541 var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(','); 553 542 $.post(ajaxurl, { 554 543 action: 'closed-postboxes', -
wp-admin/js/postbox.js
144 144 }); 145 145 146 146 if ( side.length ) { 147 if ($('#postbox-container-1').find('accordion-container')) 148 return; 149 147 150 if ( side.children('.postbox:visible').length ) 148 151 side.removeClass('empty-container'); 149 152 else if ( $('#postbox-container-1').css('width') == '280px' ) -
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' ); -
wp-admin/css/wp-admin.css
7211 7211 border-radius: 3px; 7212 7212 } 7213 7213 7214 #nav-menu-meta .accordion-container .accordion-section:first-child { 7215 -webkit-border-top-right-radius: 3px; 7216 -webkit-border-top-left-radius: 3px; 7217 border-top-right-radius: 3px; 7218 border-top-left-radius: 3px; 7219 } 7220 7221 #nav-menu-meta .accordion-container .accordion-section:last-child { 7222 -webkit-border-bottom-right-radius: 3px; 7223 -webkit-border-bottom-left-radius: 3px; 7224 border-bottom-right-radius: 3px; 7225 border-bottom-left-radius: 3px; 7226 } 7227 7214 7228 .accordion-section ul.category-tabs, 7215 7229 .accordion-section ul.add-menu-item-tabs, 7216 7230 .accordion-section ul.wp-tab-bar { … … 7221 7235 margin: 13px 0; 7222 7236 } 7223 7237 7224 #nav-menu-meta .accordion-section-content {7225 padding: 18px 13px;7226 }7227 7228 7238 #nav-menu-meta .button-controls { 7229 7239 margin-bottom: 0; 7230 7240 } … … 7441 7451 margin-top: 0; 7442 7452 } 7443 7453 7444 .accordion-container .accordion-section:first-child {7445 -webkit-border-top-right-radius: 3px;7446 -webkit-border-top-left-radius: 3px;7447 border-top-right-radius: 3px;7448 border-top-left-radius: 3px;7449 }7450 7451 .accordion-container .accordion-section:last-child {7452 -webkit-border-bottom-right-radius: 3px;7453 -webkit-border-bottom-left-radius: 3px;7454 border-bottom-right-radius: 3px;7455 border-bottom-left-radius: 3px;7456 }7457 7458 7454 .customlinkdiv .howto input { 7459 7455 width: 180px; 7460 7456 } … … 8897 8893 8898 8894 .accordion-section-content { 8899 8895 display: none; 8900 padding: 10px 20px 15px;8896 padding: 8px 13px 13px; 8901 8897 overflow: hidden; 8902 8898 } 8903 8899 8900 #submitdiv .accordion-section-content { 8901 padding: 0; 8902 } 8903 8904 8904 .accordion-section-title { 8905 8905 margin: 0; 8906 8906 padding: 15px 20px; … … 8945 8945 display: none; 8946 8946 } 8947 8947 8948 .control-section .accordion-section-title { 8948 .control-section .accordion-section-title, 8949 #poststuff .control-section .accordion-section-title { 8949 8950 padding: 10px 20px; 8950 8951 font-size: 15px; 8951 8952 font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; … … 8971 8972 .control-section:hover .accordion-section-title, 8972 8973 .control-section .accordion-section-title:hover, 8973 8974 .control-section.open .accordion-section-title, 8974 .control-section .accordion-section-title:focus { 8975 .control-section .accordion-section-title:focus, 8976 #poststuff .control-section:hover .accordion-section-title, 8977 #poststuff .control-section .accordion-section-title:hover, 8978 #poststuff .control-section.open .accordion-section-title, 8979 #poststuff .control-section .accordion-section-title:focus { 8975 8980 color: #fff; 8976 8981 text-shadow: 0 -1px 0 #333; 8977 8982 background: #808080;