Fix page reordering bug with ParentID

If you are viewing PageA in the CMS, but move PageB into PageC,
the edit form will recieve an edit form ParentID of PageC.
This is incorrect, as only PageB had it's ParentID change.
This commit is contained in:
Stephen Shkardoon 2015-10-12 20:10:48 +13:00
parent 04e167ad4c
commit 6030854725

View File

@ -105,7 +105,10 @@
SiblingIDs: siblingIDs
},
success: function() {
$('.cms-edit-form :input[name=ParentID]').val(newParentID);
// We only need to update the ParentID if the current page we're on is the page being moved
if ($('.cms-edit-form :input[name=ID]').val() == nodeID) {
$('.cms-edit-form :input[name=ParentID]').val(newParentID);
}
self.updateNodesFromServer([nodeID]);
},
statusCode: {