From f3912f32d891b7169e5210d7bc30d204d50d3e03 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 20 Jun 2012 21:57:27 +1200 Subject: [PATCH] BUGFIX Ensure that we only select the first item when updating tree nodes, otherwise we change the title for all nested node's text as well. --- javascript/CMSMain.EditForm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 35d8e44ac0..e0d10c5a16 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -134,7 +134,9 @@ */ updateTreeLabel: function(title) { var pageID = $('.cms-edit-form input[name=ID]').val(); - var treeItem = $('.item', $('.cms-tree').find("[data-id='" + pageID + "']")); + + // only update immediate text element, we don't want to update all the nested ones + var treeItem = $('.item:first', $('.cms-tree').find("[data-id='" + pageID + "']")); if (title && title != "") { treeItem.text(title); }