Skip to content

Commit

Permalink
BUGFIX Ensure that we only select the first item when updating tree
Browse files Browse the repository at this point in the history
nodes, otherwise we change the title for all nested node's text as well.
  • Loading branch information
halkyon committed Jun 20, 2012
1 parent 447ef16 commit f3912f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascript/CMSMain.EditForm.js
Expand Up @@ -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);
}
Expand Down

0 comments on commit f3912f3

Please sign in to comment.