- row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
- row.hide().fadeIn();
- } else
- $('#edit-'+id+' .inline-edit-save .error').html(r).show();
- } else
- $('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
+
+ if ( new_id ) {
+ option_value = new_id.replace( inlineEditTax.type + '-', '' );
+ row = $( '#' + new_id );
+ } else {
+ option_value = id;
+ row = $( inlineEditTax.what + id );
+ }
+
+ // Update the value in the Parent dropdown.
+ $( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
+
+ row.hide().fadeIn( 400, function() {
+ // Move focus back to the Quick Edit link.
+ row.find( '.editinline' ).focus();
+ wp.a11y.speak( inlineEditL10n.saved );
+ });
+
+ } else {
+ $errorSpan.html( r ).show();
+ // Some error strings may contain HTML entities (e.g. `“`), let's use the HTML element's text.
+ wp.a11y.speak( $errorSpan.text() );
+ }
+ } else {
+ $errorSpan.html( inlineEditL10n.error ).show();
+ wp.a11y.speak( inlineEditL10n.error );
+ }