Fixed bug in egwActionObject.selectAll function which caused the internal 'selectedChildren' array to be a reference to the children array and resulted in the children array being destroyed.

This commit is contained in:
Andreas Stöckel 2011-03-23 14:36:25 +00:00
parent 3ea7ca54b8
commit 0b2168e924
2 changed files with 11 additions and 6 deletions

View File

@ -1080,7 +1080,14 @@ egwActionObject.prototype.setAllSelected = function(_selected, _informParent)
}
// Copy the selected children list
this.selectedChildren = _selected ? this.children : [];
this.selectedChildren = [];
if (_selected)
{
for (var i = 0; i < this.children.length; i++)
{
this.selectedChildren.push(this.children[i]);
}
}
}

View File

@ -309,6 +309,8 @@ function egwPopupActionImplementation()
_links[k].actionObj.appendToTree(tree);
}
// We need the dummy object container in order to pass the array by
// reference
var groups = {
"groups": []
};
@ -321,12 +323,8 @@ function egwPopupActionImplementation()
var menu = new egwMenu();
// We needed the dummy object container in order to pass the array as
// reference - this is not needed anymore
groups = groups.groups;
// Build the menu layers
this._buildMenuLayer(menu, groups, _selected, true);
this._buildMenuLayer(menu, groups.groups, _selected, true);
return menu;
}