Ticket #31575: 31575.3.patch
| File 31575.3.patch, 4.8 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/css/press-this.css
1185 1185 vertical-align: middle; 1186 1186 } 1187 1187 1188 .options-open, 1189 .options-close { 1188 .options, 1189 .options.open .on-closed, 1190 .options.closed .on-open { 1190 1191 display: none; 1191 1192 } 1192 1193 1193 1194 @media (max-width: 900px) { 1194 .options-open, 1195 .options-close { 1195 .options { 1196 1196 display: block; 1197 1197 } 1198 1198 } 1199 1199 1200 .options-open.is-hidden,1201 .options-close.is-hidden,1202 1200 .options-panel-back.is-hidden { 1203 1201 display: none; 1204 1202 } 1205 1203 1206 .options -open:focus .dashicons {1204 .options:focus .dashicons { 1207 1205 color: #fff; 1208 1206 text-decoration: none; 1209 1207 } 1210 1208 1211 .options -open.dashicons {1209 .options .dashicons { 1212 1210 margin-top: 3px; 1213 1211 } 1214 1212 1215 .options -close{1213 .options { 1216 1214 color: #2ea2cc; 1217 1215 } 1218 1216 -
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 button-subtle closed"> 1205 <span class="dashicons dashicons-tag on-closed"></span> 1206 <span class="screen-reader-text on-closed"><?php _e( 'Show post options' ); ?></span> 1207 <span aria-hidden="true" class="on-open"><?php _e( 'Done' ); ?></span> 1208 <span class="screen-reader-text on-open"><?php _e( 'Hide post options' ); ?></span> 1206 1209 </button> 1207 <button type="button" class="options-close button-subtle is-hidden"><?php _e( 'Done' ); ?></button>1208 1210 </div> 1209 1211 1210 1212 <div id="scanbar" class="scan"> … … 1273 1275 </div> 1274 1276 1275 1277 <div class="options-panel-back is-hidden" tabindex="-1"></div> 1276 <div class="options-panel is-off-screen is-hidden" tabindex="-1" >1278 <div class="options-panel is-off-screen is-hidden" tabindex="-1" aria-expanded="false"> 1277 1279 <div class="post-options"> 1278 1280 1279 1281 <?php if ( $supports_formats ) : ?> -
src/wp-admin/js/press-this.js
286 286 if ( data.hasData ) { 287 287 $( '#scanbar' ).hide(); 288 288 } 289 290 if ( $( window ).width() > 900 ) { 291 $( '.options-panel' ).attr( 'aria-expanded', 'true' ); 292 } 289 293 } 290 294 291 295 /** … … 474 478 function openSidebar() { 475 479 sidebarIsOpen = true; 476 480 477 $( '.options-open, .press-this-actions, #scanbar' ).addClass( isHidden ); 478 $( '.options-close, .options-panel-back' ).removeClass( isHidden ); 481 $( '.options' ).removeClass( 'closed' ).addClass( 'open' ); 482 $( '.press-this-actions, #scanbar' ).addClass( isHidden ); 483 $( '.options-panel-back' ).removeClass( isHidden ); 479 484 480 485 $( '.options-panel' ).removeClass( offscreenHidden ) 481 .one( 'transitionend', function() { 486 .attr( 'aria-expanded', 'true' ) 487 .one( transitionEndEvent, function() { 482 488 $( '.post-option:first' ).focus(); 483 489 } ); 484 490 } … … 486 492 function closeSidebar() { 487 493 sidebarIsOpen = false; 488 494 489 $( '.options-close, .options-panel-back' ).addClass( isHidden ); 490 $( '.options-open, .press-this-actions, #scanbar' ).removeClass( isHidden ); 495 $( '.options' ).removeClass( 'open' ).addClass( 'closed' ); 496 $( '.options-panel-back' ).addClass( isHidden ); 497 $( '.press-this-actions, #scanbar' ).removeClass( isHidden ); 491 498 492 499 $( '.options-panel' ).addClass( isOffScreen ) 493 .one( 'transitionend', function() { 500 .attr( 'aria-expanded', 'false' ) 501 .one( transitionEndEvent, function() { 494 502 $( this ).addClass( isHidden ); 495 503 // Reset to options list 496 504 $( '.post-options' ).removeClass( offscreenHidden ); … … 598 606 monitorPlaceholder(); 599 607 monitorCatList(); 600 608 601 $( '.options-open' ).on( 'click.press-this', openSidebar ); 602 $( '.options-close' ).on( 'click.press-this', closeSidebar ); 609 $( '.options' ).on( 'click.press-this', function() { 610 if ( $( this ).hasClass( 'open' ) ) { 611 closeSidebar(); 612 } else { 613 openSidebar(); 614 } 615 }); 603 616 604 617 // Close the sidebar when focus moves outside of it. 605 618 $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function() { … … 610 623 if ( sidebarIsOpen && node && ! $node.hasClass( 'options-panel-back' ) && 611 624 ( node.nodeName === 'BODY' || 612 625 ( ! $node.closest( '.options-panel' ).length && 613 ! $node.closest( '.options -open' ).length ) ) ) {626 ! $node.closest( '.options' ).length ) ) ) { 614 627 615 628 closeSidebar(); 616 629 }