From 10f565cd6c4168b21aa89297a48e68f30637ce69 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 16 Mar 2013 20:46:37 +0000 Subject: [PATCH] Post locks: when a dialog is shown move focus to the text, see #23697 git-svn-id: http://core.svn.wordpress.org/trunk@23733 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 4 ++-- wp-admin/js/post.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index a73f28e134..5f420e7846 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1230,7 +1230,7 @@ function _admin_notice_post_locked() { ?>
ID, 64 ); ?>
-

display_name ) ); ?>

+

display_name ) ); ?>

@@ -1251,7 +1251,7 @@ function _admin_notice_post_locked() { ?>

-

+

').attr( 'src', received.lock_error.avatar_src.replace(/&/g, '&') ); wrap.find('div.post-locked-avatar').empty().append( avatar ); } - wrap.show(); + wrap.show().find('p.currently-editing').text( received.lock_error.text ).focus(); } + } else if ( received.new_lock ) { + $('#active_post_lock').val( received.new_lock ); } - - if ( received['new_lock'] ) - $('#active_post_lock').val( received['new_lock'].replace(/[^0-9:]+/, '') ); } }); @@ -300,6 +299,9 @@ jQuery(document).ready( function($) { postboxes.add_postbox_toggles(pagenow); + // Post locks: if the Post Locked dialog is shown, focus it. + $('#notification-dialog:visible').find('p.currently-editing').focus(); + // multi-taxonomies if ( $('#tagsdiv-post_tag').length ) { tagBox.init();