WordPress.org

Make WordPress Core

Changeset 21303


Ignore:
Timestamp:
07/22/2012 11:05:58 PM (6 years ago)
Author:
azaozz
Message:

Add tabbing from Title directly to the textarea when the Text editor is active, fixes #20834

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/autosave.dev.js

    r21300 r21303  
    9797    }
    9898
    99     //  This code is meant to allow tabbing from Title to Post if tinymce is defined.
    100     if ( typeof tinymce != 'undefined' ) {
    101         $('#title').bind('keydown.focus-tinymce', function(e) {
    102             if ( e.which != 9 )
    103                 return;
    104 
    105             if ( !e.ctrlKey && !e.altKey && !e.shiftKey && tinymce.activeEditor && !tinymce.activeEditor.isHidden() ) {
    106                 $('td.mceToolbar > a').focus();
    107                 e.preventDefault();
    108             }
    109         });
    110     }
     99    //  This code is meant to allow tabbing from Title to Post content.
     100    $('#title').bind('keydown.editor-focus', function(e) {
     101        var ed;
     102
     103        if ( e.which != 9 )
     104            return;
     105
     106        if ( !e.ctrlKey && !e.altKey && !e.shiftKey ) {
     107            if ( typeof(tinymce) != 'undefined' )
     108                ed = tinymce.get('content');
     109
     110            if ( ed && !ed.isHidden() )
     111                $('#content_tbl td.mceToolbar > a').focus();
     112            else
     113                $('#content').focus();
     114
     115            e.preventDefault();
     116        }
     117    });
    111118
    112119    // autosave new posts after a title is typed but not if Publish or Save Draft is clicked
Note: See TracChangeset for help on using the changeset viewer.