Ticket #14188: 14188.diff
| File 14188.diff, 1.4 KB (added by solarissmoke, 2 years ago) |
|---|
-
wp-admin/js/inline-edit-post.dev.js
218 218 }, 219 219 220 220 save : function(id) { 221 var params, fields, pa ge = $('.post_status_page').val() || '';221 var params, fields, parent_ID, page = $('.post_status_page').val() || ''; 222 222 223 223 if ( typeof(id) == 'object' ) 224 224 id = this.getId(id); … … 235 235 236 236 fields = $('#edit-'+id+' :input').serialize(); 237 237 params = fields + '&' + $.param(params); 238 239 // parent ID for repositioning pages if their parent is modified 240 parent_ID = $('#post_parent').val() || 0; 238 241 239 242 // make ajax request 240 243 $.post('admin-ajax.php', params, … … 245 248 if ( -1 != r.indexOf('<tr') ) { 246 249 $(inlineEditPost.what+id).remove(); 247 250 $('#edit-'+id).before(r).remove(); 251 if( parent_ID ){ 252 if( $(inlineEditPost.what + parent_ID).length == 0 ) // parent does not exist on this page 253 return; 254 255 $(inlineEditPost.what + parent_ID).after( $(inlineEditPost.what + id) ); 256 // redo alternates 257 $('#the-list>tr:odd').addClass("alternate"); 258 $('#the-list>tr:even').removeClass("alternate"); 259 } 248 260 $(inlineEditPost.what+id).hide().fadeIn(); 249 261 } else { 250 262 r = r.replace( /<.[^<>]*?>/g, '' );