From 2bd714b9d1b984925cf8392d8cf41abad76d5ac5 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 22 Aug 2012 18:29:42 +0000 Subject: [PATCH] Fix tabbing from the title to the editor on the Edit Post screen, see #21173 git-svn-id: https://develop.svn.wordpress.org/trunk@21586 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/autosave.dev.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-includes/js/autosave.dev.js b/wp-includes/js/autosave.dev.js index 4e16c862a1..e08207b51c 100644 --- a/wp-includes/js/autosave.dev.js +++ b/wp-includes/js/autosave.dev.js @@ -96,8 +96,8 @@ jQuery(document).ready( function($) { $('input#wp-preview').val(''); } - // This code is meant to allow tabbing from Title to Post content. - $('#title').bind('keydown.editor-focus', function(e) { + // This code is meant to allow tabbing from Title to Post content. + $('#title').on('keydown.editor-focus', function(e) { var ed; if ( e.which != 9 ) @@ -107,10 +107,13 @@ jQuery(document).ready( function($) { if ( typeof(tinymce) != 'undefined' ) ed = tinymce.get('content'); - if ( ed && !ed.isHidden() ) - $('#content_tbl td.mceToolbar > a').focus(); - else + if ( ed && !ed.isHidden() ) { + $(this).one('keyup', function(e){ + $('#content_tbl td.mceToolbar > a').focus(); + }); + } else { $('#content').focus(); + } e.preventDefault(); }