Ticket #33754: 33754.patch
File 33754.patch, 5.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/common.css
1786 1786 } 1787 1787 1788 1788 .postbox .handlediv { 1789 display: none; 1789 1790 float: right; 1790 width: 3 3px;1791 width: 36px; 1791 1792 height: 36px; 1793 padding: 0; 1792 1794 } 1793 1795 1794 1796 .js .postbox .handlediv { 1795 cursor: pointer;1797 display: block; 1796 1798 } 1797 1799 1798 1800 .sortable-placeholder { … … 2725 2727 2726 2728 /* Metabox collapse arrow indicators */ 2727 2729 .js .sidebar-name .sidebar-name-arrow:before, 2728 .js .meta-box-sortables .postbox .handlediv:before { 2729 right: 12px; 2730 .js .meta-box-sortables .postbox .toggle-indicator:before { 2731 position: relative; 2732 left: -1px; /* fix the dashicon horizontal alignment */ 2733 display: inline-block; 2730 2734 font: normal 20px/1 dashicons; 2731 2735 speak: none; 2732 display: inline-block; 2733 padding: 8px 10px; 2734 top: 0; 2735 position: relative; 2736 padding: 8px; 2736 2737 -webkit-font-smoothing: antialiased; 2737 2738 -moz-osx-font-smoothing: grayscale; 2738 2739 text-decoration: none !important; 2739 2740 } 2740 2741 2742 .js .sidebar-name .sidebar-name-arrow:before { 2743 padding: 10px; 2744 left: 0; 2745 } 2746 2741 2747 .js #widgets-left .sidebar-name .sidebar-name-arrow { 2742 2748 display: none; 2743 2749 } … … 2749 2755 2750 2756 /* Show the arrow only on hover */ 2751 2757 .js .sidebar-name .sidebar-name-arrow:before, 2752 .js .meta-box-sortables .postbox . handlediv:before {2758 .js .meta-box-sortables .postbox .toggle-indicator:before { 2753 2759 content: '\f142'; 2754 2760 } 2755 2761 2756 2762 .js .widgets-holder-wrap.closed .sidebar-name-arrow:before, 2757 .js .meta-box-sortables .postbox.closed .handlediv :before {2763 .js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before { 2758 2764 content: '\f140'; 2759 2765 } 2760 2766 … … 2889 2895 2890 2896 .widget-action:hover, 2891 2897 .handlediv:hover, 2898 .handlediv:focus, 2892 2899 .item-edit:hover, 2893 2900 .sidebar-name:hover .sidebar-name-arrow, 2894 2901 .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.php
1096 1096 $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; 1097 1097 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; 1098 1098 if ( 'dashboard_browser_nag' != $box['id'] ) { 1099 echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">'; 1100 echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />'; 1099 echo '<button type="button" class="handlediv button-link" aria-expanded="true">'; 1100 echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $box['title'] ) . '</span>'; 1101 echo '<span class="toggle-indicator" aria-hidden="true"></span>'; 1101 1102 echo '</button>'; 1102 1103 } 1103 1104 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 p = $( this ).parent( '.postbox' ), 17 id = p.attr( 'id' ), 18 ariaExpandedValue; 16 19 17 20 if ( 'dashboard_browser_nag' == id ) 18 21 return; 19 22 20 e.preventDefault();21 22 23 p.toggleClass( 'closed' ); 23 $(this).attr( 'aria-expanded', ! p.hasClass( 'closed' ) );24 24 25 ariaExpandedValue = ! p.hasClass( 'closed' ); 26 27 if ( $( this ).hasClass( 'handlediv' ) ) { 28 // The handle button was clicked. 29 $( this ).attr( 'aria-expanded', ariaExpandedValue ); 30 } else { 31 // The handle heading was clicked. 32 $( this ).closest( '.postbox' ).find( 'button.handlediv' ).attr( 'aria-expanded', ariaExpandedValue ); 33 } 34 25 35 if ( page != 'press-this' ) 26 36 self.save_state(page); 27 37 … … 74 84 }, 75 85 76 86 init : function(page, args) { 77 var isMobile = $(document.body).hasClass('mobile'); 87 var isMobile = $( document.body ).hasClass( 'mobile' ), 88 $handleButtons = $( '.postbox .handlediv' ); 78 89 79 90 $.extend( this, args || {} ); 80 91 $('#wpbody-content').css('overflow','hidden'); … … 112 123 } 113 124 114 125 this._mark_area(); 126 127 // Set the `aria-expanded` handle buttons attribute on page load. 128 $handleButtons.each( function() { 129 var p = $( this ).parent( '.postbox' ); 130 $( this ).attr( 'aria-expanded', ! p.hasClass( 'closed' ) ); 131 }); 115 132 }, 116 133 117 134 save_state : function(page) {