Browse files

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.
  • Loading branch information...
1 parent 447ef16 commit f3912f32d891b7169e5210d7bc30d204d50d3e03 @halkyon halkyon committed Jun 20, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 javascript/CMSMain.EditForm.js
View
4 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);
}

0 comments on commit f3912f3

Please sign in to comment.