mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-23 13:51:12 +01:00
Add child action visbile/enabled checking - previously children were always enabled
This commit is contained in:
parent
46d7c0e615
commit
b3806e3e8e
@ -1711,17 +1711,9 @@ egwActionObject.prototype._getLinks = function(_objs, _actionType)
|
|||||||
{
|
{
|
||||||
var actionLinks = {};
|
var actionLinks = {};
|
||||||
var testedSelected = [];
|
var testedSelected = [];
|
||||||
for (var i = 0; i < _objs.length; i++)
|
|
||||||
{
|
|
||||||
var obj = _objs[i];
|
|
||||||
if (!egwBitIsSet(obj.flags, EGW_AO_FLAG_IS_CONTAINER) && obj.triggerCallback())
|
|
||||||
{
|
|
||||||
testedSelected.push(obj);
|
|
||||||
|
|
||||||
for (var j = 0; j < obj.actionLinks.length; j++)
|
var test = function(olink)
|
||||||
{
|
{
|
||||||
var olink = obj.actionLinks[j]; //object link
|
|
||||||
|
|
||||||
// Test whether the action type is of the given implementation type
|
// Test whether the action type is of the given implementation type
|
||||||
if (olink.actionObj.type == _actionType)
|
if (olink.actionObj.type == _actionType)
|
||||||
{
|
{
|
||||||
@ -1741,9 +1733,36 @@ egwActionObject.prototype._getLinks = function(_objs, _actionType)
|
|||||||
olink.enabled && olink.visible;
|
olink.enabled && olink.visible;
|
||||||
llink.visible = (llink.visible || olink.visible);
|
llink.visible = (llink.visible || olink.visible);
|
||||||
llink.cnt++;
|
llink.cnt++;
|
||||||
|
|
||||||
|
// Add in children, so they can get checked for visible / enabled
|
||||||
|
if(olink.actionObj && olink.actionObj.children.length > 0)
|
||||||
|
{
|
||||||
|
for(var j = 0; j < olink.actionObj.children.length; j++)
|
||||||
|
{
|
||||||
|
var child = olink.actionObj.children[j];
|
||||||
|
test({
|
||||||
|
actionObj: child,
|
||||||
|
actionId: child.id,
|
||||||
|
enabled: olink.enabled,
|
||||||
|
visible: olink.visible
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = 0; i < _objs.length; i++)
|
||||||
|
{
|
||||||
|
var obj = _objs[i];
|
||||||
|
if (!egwBitIsSet(obj.flags, EGW_AO_FLAG_IS_CONTAINER) && obj.triggerCallback())
|
||||||
|
{
|
||||||
|
testedSelected.push(obj);
|
||||||
|
|
||||||
|
for (var j = 0; j < obj.actionLinks.length; j++)
|
||||||
|
{
|
||||||
|
test(obj.actionLinks[j]); //object link
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether all objects supported the action
|
// Check whether all objects supported the action
|
||||||
|
Loading…
Reference in New Issue
Block a user