Ticket #33754: 33754.2.patch
File 33754.2.patch, 5.5 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/common.css
1831 1831 } 1832 1832 1833 1833 .postbox .handlediv { 1834 display: none; 1834 1835 float: right; 1835 width: 3 3px;1836 width: 36px; 1836 1837 height: 36px; 1838 padding: 0; 1837 1839 } 1838 1840 1839 1841 .js .postbox .handlediv { 1840 cursor: pointer;1842 display: block; 1841 1843 } 1842 1844 1843 1845 .sortable-placeholder { … … 2770 2772 2771 2773 /* Metabox collapse arrow indicators */ 2772 2774 .js .sidebar-name .sidebar-name-arrow:before, 2773 .js .meta-box-sortables .postbox .handlediv:before { 2774 right: 12px; 2775 .js .meta-box-sortables .postbox .toggle-indicator:before { 2776 position: relative; 2777 left: -1px; /* fix the dashicon horizontal alignment */ 2778 display: inline-block; 2775 2779 font: normal 20px/1 dashicons; 2776 2780 speak: none; 2777 display: inline-block; 2778 padding: 8px 10px; 2779 top: 0; 2780 position: relative; 2781 padding: 8px; 2781 2782 -webkit-font-smoothing: antialiased; 2782 2783 -moz-osx-font-smoothing: grayscale; 2783 2784 text-decoration: none !important; 2784 2785 } 2785 2786 2787 .js .sidebar-name .sidebar-name-arrow:before { 2788 padding: 10px; 2789 left: 0; 2790 } 2791 2786 2792 .js #widgets-left .sidebar-name .sidebar-name-arrow { 2787 2793 display: none; 2788 2794 } … … 2794 2800 2795 2801 /* Show the arrow only on hover */ 2796 2802 .js .sidebar-name .sidebar-name-arrow:before, 2797 .js .meta-box-sortables .postbox . handlediv:before {2803 .js .meta-box-sortables .postbox .toggle-indicator:before { 2798 2804 content: "\f142"; 2799 2805 } 2800 2806 2801 2807 .js .widgets-holder-wrap.closed .sidebar-name-arrow:before, 2802 .js .meta-box-sortables .postbox.closed .handlediv :before {2808 .js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before { 2803 2809 content: "\f140"; 2804 2810 } 2805 2811 … … 2925 2931 2926 2932 .widget-action:hover, 2927 2933 .handlediv:hover, 2934 .handlediv:focus, 2928 2935 .item-edit:hover, 2929 2936 .sidebar-name:hover .sidebar-name-arrow, 2930 2937 .accordion-section-title:hover:after { -
src/wp-admin/css/widgets.css
147 147 margin: 0 10px 0 0; 148 148 } 149 149 150 div#widgets-left .sidebar-name .sidebar-name-arrow:before { 151 right: 0; 152 top: 4px; 153 padding: 4px 6px 4px 4px; 150 #widgets-left .sidebar-name .sidebar-name-arrow:before { 151 padding: 9px; 154 152 } 155 153 156 154 #widgets-left #available-widgets, … … 250 248 } 251 249 252 250 div#widgets-right .sidebar-name .sidebar-name-arrow:before { 253 right: 0; 254 top: 4px; 251 top: 2px; 255 252 } 256 253 257 254 div#widgets-right .widget-top { -
src/wp-admin/includes/template-functions.php
984 984 $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; 985 985 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; 986 986 if ( 'dashboard_browser_nag' != $box['id'] ) { 987 echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">'; 988 echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />'; 987 echo '<button type="button" class="handlediv button-link" aria-expanded="true">'; 988 echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $box['title'] ) . '</span>'; 989 echo '<span class="toggle-indicator" aria-hidden="true"></span>'; 989 990 echo '</button>'; 990 991 } 991 992 echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n"; -
src/wp-admin/js/postbox.js
7 7 8 8 postboxes = { 9 9 add_postbox_toggles : function(page, args) { 10 var self = this; 10 var self = this, 11 $handles = $( '.postbox .hndle, .postbox .handlediv' ); 11 12 12 13 self.init(page, args); 13 14 14 $('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function( e ) { 15 var p = $(this).parent('.postbox'), id = p.attr('id'); 15 $handles.on( 'click.postboxes', function() { 16 var $el = $( this ), 17 p = $el.parent( '.postbox' ), 18 id = p.attr( 'id' ), 19 ariaExpandedValue; 16 20 17 21 if ( 'dashboard_browser_nag' == id ) 18 22 return; 19 23 20 e.preventDefault();21 22 24 p.toggleClass( 'closed' ); 23 $(this).attr( 'aria-expanded', ! p.hasClass( 'closed' ) );24 25 26 ariaExpandedValue = ! p.hasClass( 'closed' ); 27 28 if ( $el.hasClass( 'handlediv' ) ) { 29 // The handle button was clicked. 30 $el.attr( 'aria-expanded', ariaExpandedValue ); 31 } else { 32 // The handle heading was clicked. 33 $el.closest( '.postbox' ).find( 'button.handlediv' ).attr( 'aria-expanded', ariaExpandedValue ); 34 } 35 25 36 if ( page != 'press-this' ) 26 37 self.save_state(page); 27 38 … … 74 85 }, 75 86 76 87 init : function(page, args) { 77 var isMobile = $(document.body).hasClass('mobile'); 88 var isMobile = $( document.body ).hasClass( 'mobile' ), 89 $handleButtons = $( '.postbox .handlediv' ); 78 90 79 91 $.extend( this, args || {} ); 80 92 $('#wpbody-content').css('overflow','hidden'); … … 112 124 } 113 125 114 126 this._mark_area(); 127 128 // Set the handle buttons `aria-expanded` attribute initial value on page load. 129 $handleButtons.each( function() { 130 $( this ).attr( 'aria-expanded', ! $( this ).parent( '.postbox' ).hasClass( 'closed' ) ); 131 }); 115 132 }, 116 133 117 134 save_state : function(page) {