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: https://develop.svn.wordpress.org/trunk@24059 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-04-22 20:52:43 +00:00
parent de6fba2b41
commit ccfda3dcb1
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();
}