Make WordPress Core


Ignore:
Timestamp:
03/30/2015 03:08:30 AM (9 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.