Ticket #31575: 31575.2.patch
File 31575.2.patch, 6.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/press-this.css
854 854 855 855 .add-cat-toggle { 856 856 float: right; 857 margin-top: -33px; 857 margin-top: -45px; 858 line-height: 20px; 859 padding: 12px 10px 8px; 858 860 } 859 861 862 .add-cat-toggle.is-toggled { 863 padding: 10px; 864 } 865 860 866 .add-cat-toggle:focus { 861 867 text-decoration: none; 862 868 color: #2ea2cc; 863 869 } 864 870 865 .add-cat-toggle.is-toggled {866 margin-top: -36px;867 }868 869 871 .add-cat-toggle.is-toggled .dashicons:before { 870 872 content: "\f179"; 871 873 } … … 1185 1187 vertical-align: middle; 1186 1188 } 1187 1189 1188 .options-open, 1189 .options-close { 1190 .options-toggle { 1190 1191 display: none; 1191 1192 } 1192 1193 1193 1194 @media (max-width: 900px) { 1194 .options-open, 1195 .options-close { 1195 .options-toggle { 1196 1196 display: block; 1197 1197 } 1198 1198 } 1199 1199 1200 .options-open .is-hidden,1201 .options-close .is-hidden,1200 .options-open-label.is-hidden, 1201 .options-close-label.is-hidden, 1202 1202 .options-panel-back.is-hidden { 1203 1203 display: none; 1204 1204 } 1205 1205 1206 .options-open:focus .dashicons { 1206 .options-toggle:hover .dashicons, 1207 .options-toggle:focus .dashicons { 1207 1208 color: #fff; 1208 1209 text-decoration: none; 1209 1210 } 1210 1211 1211 .options- open.dashicons {1212 .options-toggle .dashicons { 1212 1213 margin-top: 3px; 1213 1214 } 1214 1215 1215 .options-close {1216 .options-close-label { 1216 1217 color: #2ea2cc; 1217 1218 } 1218 1219 -
src/wp-admin/includes/class-wp-press-this.php
1201 1201 <span class="current-site-name"><?php bloginfo( 'name' ); ?></span> 1202 1202 </a> 1203 1203 </h1> 1204 <button type="button" class="options-open button-subtle"> 1205 <span class="dashicons dashicons-tag"></span><span class="screen-reader-text"><?php _e( 'Show post options' ); ?></span> 1204 <button type="button" class="options-toggle button-subtle" aria-expanded="false" aria-controls="options-panel"> 1205 <span class="options-open-label"><span class="dashicons dashicons-tag"></span><span class="screen-reader-text"><?php _e( 'Show post options' ); ?></span></span> 1206 <span class="options-close-label is-hidden"><span aria-hidden="true"><?php _e( 'Done' ); ?></span><span class="screen-reader-text"><?php _e( 'Close post options' ); ?></span></span> 1206 1207 </button> 1207 <button type="button" class="options-close button-subtle is-hidden"><?php _e( 'Done' ); ?></button>1208 1208 </div> 1209 1209 1210 1210 <div id="scanbar" class="scan"> … … 1273 1273 </div> 1274 1274 1275 1275 <div class="options-panel-back is-hidden" tabindex="-1"></div> 1276 <div class="options-panel is-off-screen is-hidden" tabindex="-1" >1276 <div class="options-panel is-off-screen is-hidden" tabindex="-1" id="options-panel"> 1277 1277 <div class="post-options"> 1278 1278 1279 1279 <?php if ( $supports_formats ) : ?> -
src/wp-admin/js/press-this.js
470 470 471 471 /** 472 472 * Interactive behavior for the sidebar toggle, to show the options modals 473 * 474 * @param action string Optional toggle|close (defaults to toggle) 473 475 */ 474 function openSidebar() { 475 sidebarIsOpen = true; 476 function toggleSidebar( event, action ) { 476 477 477 $( '.options-open, .press-this-actions, #scanbar' ).addClass( isHidden ); 478 $( '.options-close, .options-panel-back' ).removeClass( isHidden ); 478 if ( ! action ) { 479 action = 'toggle'; 480 } 479 481 480 $( '.options-panel' ).removeClass( offscreenHidden ) 481 .one( 'transitionend', function() { 482 $( '.post-option:first' ).focus(); 483 } ); 484 } 482 if ( ! sidebarIsOpen ) { 483 sidebarIsOpen = true; 485 484 486 function closeSidebar() { 487 sidebarIsOpen = false; 485 $( '.options-toggle' ).attr( 'aria-expanded', 'true' ); 486 $( '.options-open-label, .press-this-actions, #scanbar' ).addClass( isHidden ); 487 $( '.options-close-label, .options-panel-back' ).removeClass( isHidden ); 488 488 489 $( '.options-close, .options-panel-back' ).addClass( isHidden ); 490 $( '.options-open, .press-this-actions, #scanbar' ).removeClass( isHidden ); 489 $( '.options-panel' ).removeClass( offscreenHidden ) 490 .one( 'transitionend', function() { 491 $( '.post-option:first' ).focus(); 492 } ); 493 return; 494 } 491 495 492 $( '.options-panel' ).addClass( isOffScreen ) 493 .one( 'transitionend', function() { 494 $( this ).addClass( isHidden ); 495 // Reset to options list 496 $( '.post-options' ).removeClass( offscreenHidden ); 497 $( '.setting-modal').addClass( offscreenHidden ); 498 }); 496 if ( 'close' === action || sidebarIsOpen ) { 497 sidebarIsOpen = false; 498 499 $( '.options-toggle' ).attr( 'aria-expanded', 'false' ); 500 $( '.options-close-label, .options-panel-back' ).addClass( isHidden ); 501 $( '.options-open-label, .press-this-actions, #scanbar' ).removeClass( isHidden ); 502 503 $( '.options-panel' ).addClass( isOffScreen ) 504 .one( 'transitionend', function() { 505 $( this ).addClass( isHidden ); 506 // Reset to options list 507 $( '.post-options' ).removeClass( offscreenHidden ); 508 $( '.setting-modal').addClass( offscreenHidden ); 509 } ); 510 return; 511 } 499 512 } 500 513 501 514 /** … … 598 611 monitorPlaceholder(); 599 612 monitorCatList(); 600 613 601 $( '.options-open' ).on( 'click.press-this', openSidebar ); 602 $( '.options-close' ).on( 'click.press-this', closeSidebar ); 614 $( '.options-toggle' ).on( 'click.press-this', toggleSidebar ); 603 615 604 616 // Close the sidebar when focus moves outside of it. 605 $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function( ) {617 $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function( event ) { 606 618 setTimeout( function() { 607 619 var node = document.activeElement, 608 620 $node = $( node ); … … 610 622 if ( sidebarIsOpen && node && ! $node.hasClass( 'options-panel-back' ) && 611 623 ( node.nodeName === 'BODY' || 612 624 ( ! $node.closest( '.options-panel' ).length && 613 ! $node.closest( '.options- open' ).length ) ) ) {625 ! $node.closest( '.options-toggle' ).length ) ) ) { 614 626 615 closeSidebar();627 toggleSidebar( event, 'close' ); 616 628 } 617 629 }, 50 ); 618 630 });