Ticket #33327: 33327.2.diff
| File 33327.2.diff, 12.2 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/css/customize-controls.css
611 611 612 612 /* Style for custom settings */ 613 613 614 /* 614 /** 615 615 * Dropdowns 616 616 */ 617 617 618 .accordion-section .dropdown { 618 619 float: left; 619 620 display: block; … … 694 695 * iOS can't scroll iframes, 695 696 * instead it expands the iframe size to match the size of the content 696 697 */ 698 697 699 .ios .wp-full-overlay { 698 700 position: relative; 699 701 } … … 706 708 -webkit-overflow-scrolling: touch; 707 709 } 708 710 709 /* * Media controls **/711 /* Media controls */ 710 712 711 713 .customize-control-media .current, 712 714 .customize-control-upload .current, … … 991 993 /** 992 994 * Themes 993 995 */ 996 994 997 @-webkit-keyframes customize-reload { 995 998 0% { opacity: 0; } 996 999 100% { opacity: 1; } … … 1224 1227 margin: 25px 0 20px; 1225 1228 } 1226 1229 1230 /** 1231 * Widgets and Menus common styles 1232 */ 1233 1234 /* higher specificity than .wp-core-ui .button-secondary */ 1235 #customize-theme-controls .add-new-widget, 1236 #customize-theme-controls .add-new-menu-item { 1237 cursor: pointer; 1238 float: right; 1239 margin-left: 10px; 1240 -webkit-transition: all 0.2s; 1241 transition: all 0.2s; 1242 -webkit-user-select: none; 1243 -moz-user-select: none; 1244 -ms-user-select: none; 1245 user-select: none; 1246 outline: none; 1247 } 1248 1249 .reordering .add-new-widget, 1250 .reordering .add-new-menu-item { 1251 opacity: 0.2; 1252 pointer-events: none; 1253 cursor: not-allowed; /* doesn't work in conjunction with pointer-events */ 1254 } 1255 1256 .add-new-widget:before, 1257 .add-new-menu-item:before { 1258 content: "\f132"; 1259 display: inline-block; 1260 position: relative; 1261 left: -2px; 1262 top: -1px; 1263 font: normal 20px/1 dashicons; 1264 vertical-align: middle; 1265 -webkit-transition: all 0.2s; 1266 transition: all 0.2s; 1267 -webkit-font-smoothing: antialiased; 1268 -moz-osx-font-smoothing: grayscale; 1269 } 1270 1271 /* Reordering */ 1272 .reorder-toggle { 1273 float: right; 1274 padding: 5px 8px; 1275 text-decoration: none; 1276 cursor: pointer; 1277 outline: none; 1278 -webkit-user-select: none; 1279 -moz-user-select: none; 1280 -ms-user-select: none; 1281 user-select: none; 1282 } 1283 1284 .reorder-toggle:focus { 1285 outline: 1px dotted; 1286 } 1287 1288 .reorder, 1289 .reordering .reorder-done { 1290 display: block; 1291 padding: 5px 8px; 1292 } 1293 1294 .reorder-done, 1295 .reordering .reorder { 1296 display: none; 1297 color: #0073aa; 1298 } 1299 1300 .reorder-toggle:hover .reorder-done, 1301 .reorder-toggle:active .reorder-done, 1302 .reorder-toggle:focus .reorder-done { 1303 color: #00a0d2; 1304 } 1305 1227 1306 /* Responsive */ 1228 1307 .customize-controls-preview-toggle { 1229 1308 display: none; -
src/wp-admin/css/customize-nav-menus.css
90 90 box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8); 91 91 } 92 92 93 /* Menu-item reordering nav. */ 94 .reordering .customize-control-nav_menu .reorder, 95 .customize-control-nav_menu .reorder-done { 96 display: none; 97 } 93 /** 94 * Menu items reordering styles 95 */ 98 96 99 .customize-control-nav_menu .reorder,100 .reordering .customize-control-nav_menu .reorder-done {101 display: inline-block;102 padding: 5px 8px;103 }104 105 97 .menu-item-reorder-nav { 106 98 display: none; 107 99 background-color: #fff; … … 110 102 right: 0; 111 103 } 112 104 113 #customize-theme-controls .reordering .add-new-menu-item {114 opacity: 0.2;115 pointer-events: none;116 cursor: not-allowed;117 }118 119 105 .menu-item-reorder-nav button { 120 106 position: relative; 121 107 overflow: hidden; … … 361 347 362 348 .wp-customizer button:focus .toggle-indicator:after { 363 349 -webkit-box-shadow: 364 0 0 0 1px #5b9dd9,350 0 0 0 1px #5b9dd9, 365 351 0 0 2px 1px rgba(30, 140, 190, .8); 366 box-shadow:367 0 0 0 1px #5b9dd9,352 box-shadow: 353 0 0 0 1px #5b9dd9, 368 354 0 0 2px 1px rgba(30, 140, 190, .8); 369 355 } 370 356 … … 479 465 margin-top: 0; 480 466 } 481 467 482 /* 483 * Add-menu-items mode .468 /** 469 * Add-menu-items mode 484 470 */ 471 485 472 .wp-full-overlay-main { 486 473 right: auto; /* This overrides a right: 0; which causes the preview to resize rather than slide off screen at the normal size. */ 487 474 width: 100%; … … 496 483 opacity: 1; 497 484 } 498 485 499 /* Add-new button. */500 #customize-theme-controls .add-new-menu-item {501 cursor: pointer;502 float: right;503 margin-left: 10px;504 -webkit-transition: all 0.2s;505 transition: all 0.2s;506 -webkit-user-select: none;507 -moz-user-select: none;508 -ms-user-select: none;509 user-select: none;510 outline: none;511 }512 513 .add-new-menu-item:before {514 content: "\f132";515 display: inline-block;516 position: relative;517 left: -2px;518 top: -1px;519 font: normal 20px/1 dashicons;520 vertical-align: middle;521 -webkit-transition: all 0.2s;522 transition: all 0.2s;523 -webkit-font-smoothing: antialiased;524 -moz-osx-font-smoothing: grayscale;525 }526 527 486 .adding-menu-items .add-new-menu-item, 528 487 .adding-menu-items .add-new-menu-item:hover, 529 488 .add-menu-toggle.open, -
src/wp-admin/css/customize-widgets.css
117 117 } 118 118 119 119 /** 120 * Widget reordering styles121 **/120 * Widget reordering styles 121 */ 122 122 123 .reorder-toggle {124 float: right;125 padding: 5px 8px;126 text-decoration: none;127 cursor: pointer;128 outline: none;129 -webkit-user-select: none;130 -moz-user-select: none;131 -ms-user-select: none;132 user-select: none;133 }134 .reorder-toggle:focus {135 outline: 1px dotted;136 }137 138 .reorder-done,139 .reordering .reorder {140 display: none;141 }142 143 .reordering .reorder-done {144 display: block;145 color: #0073aa;146 }147 148 .reordering .reorder-done:hover,149 .reordering .reorder-done:active {150 color: #00a0d2;151 }152 153 #customize-theme-controls .reordering .add-new-widget {154 opacity: 0.2;155 pointer-events: none;156 cursor: not-allowed;157 }158 159 123 #customize-theme-controls .widget-reorder-nav { 160 124 display: none; 161 125 float: right; … … 213 177 cursor: default; 214 178 } 215 179 216 #customize-theme-controls .move-widget-area {180 #customize-theme-controls .move-widget-area { 217 181 display: none; 218 182 background: #fff; 219 183 border: 1px solid #dedede; … … 288 252 display: block; 289 253 } 290 254 291 292 255 /** 293 256 * Styles for new widget addition panel 294 257 */ 258 295 259 .wp-full-overlay-main { 296 260 right: auto; /* this overrides a right: 0; which causes the preview to resize, I'd rather have it go off screen at the normal size. */ 297 261 width: 100%; 298 262 } 299 263 300 #customize-theme-controls .add-new-widget {301 cursor: pointer;302 float: right;303 margin-left: 10px;304 -webkit-transition: all 0.2s;305 transition: all 0.2s;306 -webkit-user-select: none;307 -moz-user-select: none;308 -ms-user-select: none;309 user-select: none;310 outline: none;311 }312 313 .add-new-widget:before {314 content: "\f132";315 display: inline-block;316 position: relative;317 left: -2px;318 top: -1px;319 font: normal 20px/1 dashicons;320 vertical-align: middle;321 -webkit-transition: all 0.2s;322 transition: all 0.2s;323 -webkit-font-smoothing: antialiased;324 -moz-osx-font-smoothing: grayscale;325 }326 327 264 body.adding-widget .add-new-widget, 328 265 body.adding-widget .add-new-widget:hover { 329 266 background: #eee; … … 456 393 * Widget Icon styling 457 394 * No plurals in naming. 458 395 * Ordered from lowest to highest specificity. 459 **/ 396 */ 397 460 398 #available-widgets .widget-title { 461 399 position: relative; 462 400 } -
src/wp-admin/js/customize-widgets.js
1718 1718 /** 1719 1719 * Keyboard-accessible reordering 1720 1720 */ 1721 this.container.find( '.reorder-toggle' ).on( 'click keydown', function( event ) { 1722 if ( event.type === 'keydown' && ! ( event.which === 13 || event.which === 32 ) ) { // Enter or Spacebar 1723 return; 1724 } 1725 1721 this.container.find( '.reorder-toggle' ).on( 'click', function() { 1726 1722 self.toggleReordering( ! self.isReordering ); 1727 1723 } ); 1728 1724 }, … … 1733 1729 _setupAddition: function() { 1734 1730 var self = this; 1735 1731 1736 this.container.find( '.add-new-widget' ).on( 'click keydown', function( event ) { 1737 if ( event.type === 'keydown' && ! ( event.which === 13 || event.which === 32 ) ) { // Enter or Spacebar 1738 return; 1739 } 1732 this.container.find( '.add-new-widget' ).on( 'click', function() { 1733 var addNewWidgetBtn = $( this ); 1740 1734 1741 1735 if ( self.$sectionContent.hasClass( 'reordering' ) ) { 1742 1736 return; … … 1743 1737 } 1744 1738 1745 1739 if ( ! $( 'body' ).hasClass( 'adding-widget' ) ) { 1740 addNewWidgetBtn.attr( 'aria-expanded', 'true' ); 1746 1741 api.Widgets.availableWidgetsPanel.open( self ); 1747 1742 } else { 1743 addNewWidgetBtn.attr( 'aria-expanded', 'false' ); 1748 1744 api.Widgets.availableWidgetsPanel.close(); 1749 1745 } 1750 1746 } ); … … 1798 1794 * @todo We should have a reordering state instead and rename this to onChangeReordering 1799 1795 */ 1800 1796 toggleReordering: function( showOrHide ) { 1797 var addNewWidgetBtn = this.$sectionContent.find( '.add-new-widget' ), 1798 reorderBtn = this.container.find( '.reorder-toggle' ), 1799 widgetsTitle = this.$sectionContent.find( '.widget-title' ); 1800 1801 1801 showOrHide = Boolean( showOrHide ); 1802 1802 1803 1803 if ( showOrHide === this.$sectionContent.hasClass( 'reordering' ) ) { … … 1812 1812 formControl.collapse(); 1813 1813 } ); 1814 1814 1815 this.$sectionContent.find( '.first-widget .move-widget' ).focus(); 1816 this.$sectionContent.find( '.add-new-widget' ).prop( 'tabIndex', -1 ); 1815 addNewWidgetBtn.attr({ 'tabindex': '-1', 'aria-hidden': 'true' }); 1816 reorderBtn.attr( 'aria-label', l10n.reorderLabelOff ); 1817 wp.a11y.speak( l10n.reorderModeOn ); 1818 // Hide widget titles while reordering: title is already in the reorder controls. 1819 widgetsTitle.attr( 'aria-hidden', 'true' ); 1817 1820 } else { 1818 this.$sectionContent.find( '.add-new-widget' ).prop( 'tabIndex', 0 ); 1821 addNewWidgetBtn.removeAttr( 'tabindex aria-hidden' ); 1822 reorderBtn.attr( 'aria-label', l10n.reorderLabelOn ); 1823 wp.a11y.speak( l10n.reorderModeOff ); 1824 widgetsTitle.attr( 'aria-hidden', 'false' ); 1819 1825 } 1820 1826 }, 1821 1827 -
src/wp-includes/class-wp-customize-control.php
1305 1305 </span> 1306 1306 </label> 1307 1307 <div class="container"> 1308 </div> 1308 </div> 1309 1309 </div> 1310 1310 <div class="actions"> 1311 1311 <?php if ( current_user_can( 'upload_files' ) ): ?> … … 1458 1458 * @access public 1459 1459 */ 1460 1460 public function render_content() { 1461 $id = 'reorder-widgets-desc-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); 1461 1462 ?> 1462 < span class="button-secondary add-new-widget" tabindex="0">1463 <button type="button" class="button-secondary add-new-widget" aria-expanded="false" aria-controls="available-widgets"> 1463 1464 <?php _e( 'Add a Widget' ); ?> 1464 </span> 1465 1466 <span class="reorder-toggle" tabindex="0"> 1465 </button> 1466 <button type="button" class="not-a-button reorder-toggle" aria-label="<?php esc_attr_e( 'Reorder widgets' ); ?>" aria-describedby="<?php echo esc_attr( $id ); ?>"> 1467 1467 <span class="reorder"><?php _ex( 'Reorder', 'Reorder widgets in Customizer' ); ?></span> 1468 1468 <span class="reorder-done"><?php _ex( 'Done', 'Cancel reordering widgets in Customizer' ); ?></span> 1469 </span> 1469 </button> 1470 <p class="screen-reader-text" id="<?php echo esc_attr( $id ); ?>"><?php _e( 'When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.' ); ?></p> 1470 1471 <?php 1471 1472 } 1472 1473 -
src/wp-includes/class-wp-customize-widgets.php
655 655 'error' => __( 'An error has occurred. Please reload the page and try again.' ), 656 656 'widgetMovedUp' => __( 'Widget moved up' ), 657 657 'widgetMovedDown' => __( 'Widget moved down' ), 658 'reorderModeOn' => __( 'Reorder mode enabled' ), 659 'reorderModeOff' => __( 'Reorder mode closed' ), 660 'reorderLabelOn' => esc_attr__( 'Reorder' ), 661 'reorderLabelOff' => esc_attr__( 'Close reorder mode' ), 658 662 ), 659 663 'tpl' => array( 660 664 'widgetReorderNav' => $widget_reorder_nav_tpl,