Ticket #31476: 31476.2.patch
File 31476.2.patch, 8.7 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/common.css
2955 2955 2956 2956 /* @todo: can we use a common class for these? */ 2957 2957 .nav-menus-php .item-edit:before, 2958 .widget-top a.widget-action:after,2958 .widget-top .widget-action:after, 2959 2959 .control-section .accordion-section-title:after, 2960 2960 .accordion-section-title:after { 2961 2961 right: 0; … … 2983 2983 } 2984 2984 2985 2985 .widget-action:hover, 2986 .widget-action:focus, 2986 2987 .handlediv:hover, 2987 2988 .handlediv:focus, 2988 2989 .item-edit:hover, 2990 .item-edit:focus, 2989 2991 .sidebar-name:hover .sidebar-name-arrow, 2990 .accordion-section-title:hover:after { 2992 .sidebar-name:focus .sidebar-name-arrow, 2993 .accordion-section-title:hover:after, 2994 .accordion-section-title:focus:after { 2991 2995 color: #777; 2992 2996 } 2993 2997 2994 .widget-top a.widget-action:after {2998 .widget-top .widget-action:after { 2995 2999 padding: 1px 2px 1px 0px; 2996 3000 margin-top: 10px; 2997 3001 margin-right: 10px; … … 2999 3003 border-radius: 50%; 3000 3004 } 3001 3005 3002 .widget-top a.widget-action:focus:after {3006 .widget-top .widget-action:focus:after { 3003 3007 -webkit-box-shadow: 3004 3008 0 0 0 1px #5b9dd9, 3005 3009 0 0 2px 1px rgba(30,140,190,.8); … … 3018 3022 .control-section.open .accordion-section-title:after, 3019 3023 #customize-info.open .accordion-section-title:after, 3020 3024 .nav-menus-php .menu-item-edit-active .item-edit:before, 3021 .widget.open .widget-top a.widget-action:after {3025 .widget.open .widget-top .widget-action:after { 3022 3026 content: "\f142"; 3023 3027 } 3024 3028 … … 3342 3346 /* @todo: evaluate - most of these were likely replaced by dashicons */ 3343 3347 .curtime #timestamp, 3344 3348 #screen-meta-links a.show-settings, 3345 .widget-top a.widget-action,3346 .widget-top a.widget-action:hover,3349 .widget-top .widget-action, 3350 .widget-top .widget-action:hover, 3347 3351 .sidebar-name-arrow, 3348 3352 .sidebar-name:hover .sidebar-name-arrow, 3349 3353 .meta-box-sortables .postbox:hover .handlediv, -
src/wp-admin/css/customize-widgets.css
83 83 cursor: move; 84 84 } 85 85 86 .customize-control-widget_form.expanded a.widget-action:after {86 .customize-control-widget_form.expanded .widget-action:after { 87 87 content: "\f142"; 88 88 } 89 89 90 .customize-control-widget_form.wide-widget-control a.widget-action:after {90 .customize-control-widget_form.wide-widget-control .widget-action:after { 91 91 content: "\f139"; 92 92 } 93 93 94 .customize-control-widget_form.wide-widget-control.expanded a.widget-action:after {94 .customize-control-widget_form.wide-widget-control.expanded .widget-action:after { 95 95 content: "\f141"; 96 96 } 97 97 -
src/wp-admin/css/widgets.css
14 14 background: #f7f7f7; 15 15 } 16 16 17 .widget-top a.widget-action, 18 .widget-top a.widget-action:hover { 17 .widget-top .widget-action, 18 .widget-top .widget-action:hover, 19 .widget-top .button-link.widget-action:focus { 20 padding: 0; 19 21 -webkit-box-shadow: none; 20 22 box-shadow: none; 21 23 outline: none; … … 50 52 } 51 53 52 54 .deleting .widget-title, 53 .deleting .widget-top a.widget-action:after {55 .deleting .widget-top .widget-action:after { 54 56 color: #a0a5aa; 55 57 } 56 58 -
src/wp-admin/includes/widgets.php
219 219 echo $sidebar_args['before_widget']; ?> 220 220 <div class="widget-top"> 221 221 <div class="widget-title-action"> 222 <a class="widget-action hide-if-no-js" href="#available-widgets"></a> 222 <button type="button" class="button-link widget-action hide-if-no-js" aria-expanded="false"> 223 <span class="screen-reader-text"><?php printf( __( 'Edit widget: %s' ), $widget_title ); ?></span> 224 </button> 223 225 <a class="widget-control-edit hide-if-js" href="<?php echo esc_url( add_query_arg( $query_arg ) ); ?>"> 224 226 <span class="edit"><?php _ex( 'Edit', 'widget' ); ?></span> 225 227 <span class="add"><?php _ex( 'Add', 'widget' ); ?></span> … … 250 252 251 253 <div class="widget-control-actions"> 252 254 <div class="alignleft"> 253 < a class="widget-control-remove" href="#remove"><?php _e('Delete'); ?></a> |254 < a class="widget-control-close" href="#close"><?php _e('Close'); ?></a>255 <button type="button" class="button-link widget-control-remove"><?php _e( 'Delete' ); ?></button> | 256 <button type="button" class="button-link widget-control-close"><?php _e( 'Close' ); ?></button> 255 257 </div> 256 258 <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>"> 257 259 <?php submit_button( __( 'Save' ), 'button-primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?> -
src/wp-admin/js/customize-widgets.js
1322 1322 * @param {Object} args merged on top of this.defaultActiveArguments 1323 1323 */ 1324 1324 onChangeExpanded: function ( expanded, args ) { 1325 var self = this, $widget, $inside, complete, prevComplete ;1325 var self = this, $widget, $inside, complete, prevComplete, $toggleBtn; 1326 1326 1327 1327 self.embedWidgetControl(); // Make sure the outer form is embedded so that the expanded state can be set in the UI. 1328 1328 if ( expanded ) { … … 1341 1341 1342 1342 $widget = this.container.find( 'div.widget:first' ); 1343 1343 $inside = $widget.find( '.widget-inside:first' ); 1344 $toggleBtn = this.container.find( '.widget-top button.widget-action' ); 1344 1345 1345 1346 if ( expanded ) { 1346 1347 … … 1358 1359 complete = function() { 1359 1360 self.container.removeClass( 'expanding' ); 1360 1361 self.container.addClass( 'expanded' ); 1362 $toggleBtn.attr( 'aria-expanded', 'true' ); 1361 1363 self.container.trigger( 'expanded' ); 1362 1364 }; 1363 1365 if ( args.completeCallback ) { … … 1381 1383 complete = function() { 1382 1384 self.container.removeClass( 'collapsing' ); 1383 1385 self.container.removeClass( 'expanded' ); 1386 $toggleBtn.attr( 'aria-expanded', 'false' ); 1384 1387 self.container.trigger( 'collapsed' ); 1385 1388 }; 1386 1389 if ( args.completeCallback ) { -
src/wp-admin/js/widgets.js
41 41 $(document.body).bind('click.widgets-toggle', function(e) { 42 42 var target = $(e.target), 43 43 css = { 'z-index': 100 }, 44 widget, inside, targetWidth, widgetWidth, margin; 44 widget, inside, targetWidth, widgetWidth, margin, 45 toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' ); 45 46 46 47 if ( target.parents('.widget-top').length && ! target.parents('#available-widgets').length ) { 47 48 widget = target.closest('div.widget'); … … 61 62 widget.css( css ); 62 63 } 63 64 widget.addClass( 'open' ); 65 toggleBtn.attr( 'aria-expanded', 'true' ); 64 66 inside.slideDown('fast'); 65 67 } else { 66 68 inside.slideUp('fast', function() { 67 69 widget.attr( 'style', '' ); 68 70 widget.removeClass( 'open' ); 71 toggleBtn.attr( 'aria-expanded', 'false' ); 69 72 }); 70 73 } 71 74 e.preventDefault(); … … 78 81 } else if ( target.hasClass('widget-control-close') ) { 79 82 widget = target.closest('div.widget'); 80 83 widget.removeClass( 'open' ); 84 toggleBtn.attr( 'aria-expanded', 'false' ); 81 85 wpWidgets.close( widget ); 82 86 e.preventDefault(); 83 87 } else if ( target.attr( 'id' ) === 'inactive-widgets-control-remove' ) { … … 92 96 wpWidgets.appendTitle( this ); 93 97 94 98 if ( $this.find( 'p.widget-error' ).length ) { 95 $this.find( 'a.widget-action' ).trigger('click');99 + $this.find( '.widget-action' ).trigger( 'click' ).attr( 'aria-expanded', 'true' ); 96 100 } 97 101 }); 98 102 … … 182 186 183 187 if ( inside.css('display') === 'block' ) { 184 188 ui.item.removeClass('open'); 189 ui.item.find( '.widget-top button.widget-action' ).attr( 'aria-expanded', 'false' ); 185 190 inside.hide(); 186 191 $(this).sortable('refreshPositions'); 187 192 } … … 254 259 } 255 260 256 261 if ( addNew ) { 257 $widget.find( ' a.widget-action' ).trigger('click');262 $widget.find( '.widget-action' ).trigger( 'click' ); 258 263 } else { 259 264 wpWidgets.saveOrder( $sidebar.attr('id') ); 260 265 } … … 492 497 493 498 close : function(widget) { 494 499 widget.children('.widget-inside').slideUp('fast', function() { 495 widget.attr( 'style', '' ) ;500 widget.attr( 'style', '' ).find( '.widget-top button.widget-action' ).attr( 'aria-expanded', 'false' ); 496 501 }); 497 502 }, 498 503