From 415a348999c27ec24b839561ca36b91efce2d032 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Oct 2013 20:37:48 +0000 Subject: [PATCH] When Quick Edit'ing a page, checks if edited page has a new parent and moves the row underneath that one. If the parent doesn't exist on this page then it hides the row altogether. Props solarissmoke, MikeHansenMe. Fixes #14188. git-svn-id: https://develop.svn.wordpress.org/trunk@25663 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/inline-edit-post.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/inline-edit-post.js b/src/wp-admin/js/inline-edit-post.js index cc28130874..c764b9321b 100644 --- a/src/wp-admin/js/inline-edit-post.js +++ b/src/wp-admin/js/inline-edit-post.js @@ -223,7 +223,7 @@ inlineEditPost = { }, save : function(id) { - var params, fields, page = $('.post_status_page').val() || ''; + var params, fields, parent_ID, page = $('.post_status_page').val() || ''; if ( typeof(id) == 'object' ) id = this.getId(id); @@ -240,6 +240,9 @@ inlineEditPost = { fields = $('#edit-'+id+' :input').serialize(); params = fields + '&' + $.param(params); + + // parent ID for repositioning pages if their parent is modified + parent_ID = $('#post_parent').val() || 0; // make ajax request $.post( ajaxurl, params, @@ -250,6 +253,15 @@ inlineEditPost = { if ( -1 != r.indexOf('tr:odd').addClass("alternate"); + $('#the-list>tr:even').removeClass("alternate"); + } $(inlineEditPost.what+id).hide().fadeIn(); } else { r = r.replace( /<.[^<>]*?>/g, '' );