Make WordPress Core

Changeset 31925


Ignore:
Timestamp:
03/30/2015 03:08:30 AM (11 years ago)
Author:
azaozz
Message:

Press This: fix accessibility for the post options "sidebar". Fix size of the Add Category button.
Part props afercis, joedolson. Fixes #31575.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/press-this.css

    r31809 r31925  
    855855.add-cat-toggle {
    856856        float: right;
    857         margin-top: -33px;
     857        margin-top: -45px;
     858        line-height: 20px;
     859        padding: 12px 10px 8px;
    858860}
    859861
     
    864866
    865867.add-cat-toggle.is-toggled {
    866         margin-top: -36px;
     868        padding: 10px;
    867869}
    868870
     
    11861188}
    11871189
    1188 .options-open,
    1189 .options-close {
     1190.options,
     1191.options.open .on-closed,
     1192.options.closed .on-open {
    11901193        display: none;
    11911194}
    11921195
    11931196@media (max-width: 900px) {
    1194         .options-open,
    1195         .options-close {
     1197        .options {
    11961198                display: block;
    11971199        }
    11981200}
    11991201
    1200 .options-open.is-hidden,
    1201 .options-close.is-hidden,
    12021202.options-panel-back.is-hidden {
    12031203        display: none;
    12041204}
    12051205
    1206 .options-open:focus .dashicons {
     1206.options:focus .dashicons {
    12071207        color: #fff;
    12081208        text-decoration: none;
    12091209}
    12101210
    1211 .options-open .dashicons {
     1211.options .dashicons {
    12121212        margin-top: 3px;
    12131213}
    12141214
    1215 .options-close {
     1215.options {
    12161216        color: #2ea2cc;
    12171217}
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r31907 r31925  
    12021202                        </a>
    12031203                </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>
    12061209                </button>
    1207                 <button type="button" class="options-close button-subtle is-hidden"><?php _e( 'Done' ); ?></button>
    12081210        </div>
    12091211
  • trunk/src/wp-admin/js/press-this.js

    r31919 r31925  
    489489                        sidebarIsOpen = true;
    490490
    491                         $( '.options-open, .press-this-actions, #scanbar' ).addClass( isHidden );
    492                         $( '.options-close, .options-panel-back' ).removeClass( isHidden );
     491                        $( '.options' ).removeClass( 'closed' ).addClass( 'open' );
     492                        $( '.press-this-actions, #scanbar' ).addClass( isHidden );
     493                        $( '.options-panel-back' ).removeClass( isHidden );
    493494
    494495                        $( '.options-panel' ).removeClass( offscreenHidden )
    495                                 .one( 'transitionend', function() {
     496                                .one( transitionEndEvent, function() {
    496497                                        $( '.post-option:first' ).focus();
    497498                                } );
     
    501502                        sidebarIsOpen = false;
    502503
    503                         $( '.options-close, .options-panel-back' ).addClass( isHidden );
    504                         $( '.options-open, .press-this-actions, #scanbar' ).removeClass( isHidden );
     504                        $( '.options' ).removeClass( 'open' ).addClass( 'closed' );
     505                        $( '.options-panel-back' ).addClass( isHidden );
     506                        $( '.press-this-actions, #scanbar' ).removeClass( isHidden );
    505507
    506508                        $( '.options-panel' ).addClass( isOffScreen )
    507                                 .one( 'transitionend', function() {
     509                                .one( transitionEndEvent, function() {
    508510                                        $( this ).addClass( isHidden );
    509511                                        // Reset to options list
     
    621623                        monitorCatList();
    622624
    623                         $( '.options-open' ).on( 'click.press-this', openSidebar );
    624                         $( '.options-close' ).on( 'click.press-this', closeSidebar );
     625                        $( '.options' ).on( 'click.press-this', function() {
     626                                if ( $( this ).hasClass( 'open' ) ) {
     627                                        closeSidebar();
     628                                } else {
     629                                        openSidebar();
     630                                }
     631                        });
    625632
    626633                        // Close the sidebar when focus moves outside of it.
     
    633640                                                ( node.nodeName === 'BODY' ||
    634641                                                        ( ! $node.closest( '.options-panel' ).length &&
    635                                                         ! $node.closest( '.options-open' ).length ) ) ) {
     642                                                        ! $node.closest( '.options' ).length ) ) ) {
    636643
    637644                                                closeSidebar();
Note: See TracChangeset for help on using the changeset viewer.