Make WordPress Core

Changeset 33352


Ignore:
Timestamp:
07/21/2015 10:45:48 PM (11 years ago)
Author:
iseulde
Message:

Publish box: move focus when the animation is done

Also move the focus back to 'edit' when saving changes.

Props afercia.
Fixes #33060.

Location:
trunk/src/wp-admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/comment.js

    r33349 r33352  
    99        $timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
    1010                if ( $timestampdiv.is( ':hidden' ) ) {
    11                         $timestampdiv.slideDown('fast');
    12                         $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
     11                        $timestampdiv.slideDown( 'fast', function() {
     12                                $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
     13                        } );
    1314                        $(this).hide();
    1415                }
  • trunk/src/wp-admin/js/post.js

    r33349 r33352  
    608608                        if ( $postVisibilitySelect.is(':hidden') ) {
    609609                                updateVisibility();
    610                                 $postVisibilitySelect.slideDown('fast').find('input[type="radio"]').first().focus();
     610                                $postVisibilitySelect.slideDown( 'fast', function() {
     611                                        $postVisibilitySelect.find( 'input[type="radio"]' ).first().focus();
     612                                } );
    611613                                $(this).hide();
    612614                        }
    … …  
    627629                $postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // crazyhorse - multiple ok cancels
    628630                        $postVisibilitySelect.slideUp('fast');
    629                         $('#visibility .edit-visibility').show();
     631                        $('#visibility .edit-visibility').show().focus();
    630632                        updateText();
    631633
    … …  
    650652                $timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
    651653                        if ( $timestampdiv.is( ':hidden' ) ) {
    652                                 $timestampdiv.slideDown('fast');
    653                                 $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
     654                                $timestampdiv.slideDown( 'fast', function() {
     655                                        $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
     656                                } );
    654657                                $(this).hide();
    655658                        }
    … …  
    671674                        if ( updateText() ) {
    672675                                $timestampdiv.slideUp('fast');
    673                                 $timestampdiv.siblings('a.edit-timestamp').show();
     676                                $timestampdiv.siblings('a.edit-timestamp').show().focus();
    674677                        }
    675678                        event.preventDefault();
    … …  
    691694                $postStatusSelect.siblings('a.edit-post-status').click( function( event ) {
    692695                        if ( $postStatusSelect.is( ':hidden' ) ) {
    693                                 $postStatusSelect.slideDown('fast').find('select').focus();
     696                                $postStatusSelect.slideDown( 'fast', function() {
     697                                        $postStatusSelect.find('select').focus();
     698                                } );
    694699                                $(this).hide();
    695700                        }
    … …  
    698703
    699704                $postStatusSelect.find('.save-post-status').click( function( event ) {
    700                         $postStatusSelect.slideUp('fast').siblings('a.edit-post-status').show();
     705                        $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
    701706                        updateText();
    702707                        event.preventDefault();
    … …  
    704709
    705710                $postStatusSelect.find('.cancel-post-status').click( function( event ) {
    706                         $('#post-status-select').slideUp('fast').siblings( 'a.edit-post-status' ).show().focus();
     711                        $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
    707712                        $('#post_status').val( $('#hidden_post_status').val() );
    708713                        updateText();
Note: See TracChangeset for help on using the changeset viewer.