Ticket #23449: 23449.3.diff
File 23449.3.diff, 5.7 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/template.php
986 986 function do_accordion_sections( $screen, $context, $object ) { 987 987 global $wp_meta_boxes; 988 988 989 wp_enqueue_script( 'accordion' ); 990 989 991 if ( empty( $screen ) ) 990 992 $screen = get_current_screen(); 991 993 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 initAccessibility : function() { 275 266 $( '.item-edit' ).off( 'focus' ).on( 'focus', function(){ 276 267 $(this).on( 'keydown', function(e){ … … 402 393 api.menuList.hideAdvancedMenuItemFields(); 403 394 404 395 $('.hide-postbox-tog').click(function () { 405 api.initAccordion();406 407 396 var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(','); 408 397 $.post(ajaxurl, { 409 398 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
7221 7221 margin: 13px 0; 7222 7222 } 7223 7223 7224 #nav-menu-meta .accordion-section-content {7225 padding: 18px 13px;7226 }7227 7228 7224 #nav-menu-meta .button-controls { 7229 7225 margin-bottom: 0; 7230 7226 } … … 8889 8885 8890 8886 .accordion-section-content { 8891 8887 display: none; 8892 padding: 10px 20px 15px;8888 padding: 8px 13px 13px; 8893 8889 overflow: hidden; 8894 8890 } 8895 8891 8892 #submitdiv .accordion-section-content { 8893 padding: 0; 8894 } 8895 8896 8896 .accordion-section-title { 8897 8897 margin: 0; 8898 8898 padding: 15px 20px; … … 8937 8937 display: none; 8938 8938 } 8939 8939 8940 .control-section .accordion-section-title { 8940 .control-section .accordion-section-title, 8941 #poststuff .control-section .accordion-section-title { 8941 8942 padding: 10px 20px; 8942 8943 font-size: 15px; 8943 8944 font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; … … 8963 8964 .control-section:hover .accordion-section-title, 8964 8965 .control-section .accordion-section-title:hover, 8965 8966 .control-section.open .accordion-section-title, 8966 .control-section .accordion-section-title:focus { 8967 .control-section .accordion-section-title:focus, 8968 #poststuff .control-section:hover .accordion-section-title, 8969 #poststuff .control-section .accordion-section-title:hover, 8970 #poststuff .control-section.open .accordion-section-title, 8971 #poststuff .control-section .accordion-section-title:focus { 8967 8972 color: #fff; 8968 8973 text-shadow: 0 -1px 0 #333; 8969 8974 background: #808080;