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.
This commit is contained in:
Sean Harvey 2012-06-20 21:57:27 +12:00
parent 447ef16294
commit d55eb13ecc

View File

@ -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);
}