Wait until keyup to set the slug input on the post page, otherwise the final character is not stored. props SergeyBiryukov, fixes #23613.

git-svn-id: http://core.svn.wordpress.org/trunk@24059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-04-22 20:52:43 +00:00
parent c7458f78f8
commit 848304e3c0
1 changed files with 2 additions and 1 deletions

View File

@ -683,7 +683,7 @@ jQuery(document).ready( function($) {
}
slug_value = ( c > full.length / 4 ) ? '' : full;
e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e) {
var key = e.keyCode || 0;
// on enter, just save the new slug, don't save the post
if ( 13 == key ) {
@ -694,6 +694,7 @@ jQuery(document).ready( function($) {
b.children('.cancel').click();
return false;
}
}).keyup(function(e) {
real_slug.val(this.value);
}).focus();
}