allow to specify for how many selected rows an action should be shown

This commit is contained in:
Ralf Becker 2019-03-04 12:12:00 +01:00
parent 3e86e42306
commit cae866db13

View File

@ -661,9 +661,9 @@ egwAction.prototype.set_enabled = function(_value)
}; };
/** /**
* The allowOnMultiple property may be true, false or "only" * The allowOnMultiple property may be true, false, "only" (> 1) or number of select, eg. 2
* *
* @param {(boolean|string)} _value * @param {(boolean|string|number)} _value
*/ */
egwAction.prototype.set_allowOnMultiple = function(_value) egwAction.prototype.set_allowOnMultiple = function(_value)
{ {
@ -2110,7 +2110,8 @@ egwActionObject.prototype._getLinks = function(_objs, _actionType)
( (
(actionLinks[k].actionObj.allowOnMultiple === true) || (actionLinks[k].actionObj.allowOnMultiple === true) ||
(actionLinks[k].actionObj.allowOnMultiple == "only" && _objs.length > 1) || (actionLinks[k].actionObj.allowOnMultiple == "only" && _objs.length > 1) ||
(actionLinks[k].actionObj.allowOnMultiple == false && _objs.length === 1) (actionLinks[k].actionObj.allowOnMultiple == false && _objs.length === 1) ||
(typeof actionLinks[k].actionObj.allowOnMultiple === 'number' && _objs.length == actionLinks[k].actionObj.allowOnMultiple)
); );
if (!egwIsMobile()) actionLinks[k].actionObj.hideOnMobile = false; if (!egwIsMobile()) actionLinks[k].actionObj.hideOnMobile = false;
actionLinks[k].visible = actionLinks[k].visible && !actionLinks[k].actionObj.hideOnMobile && actionLinks[k].visible = actionLinks[k].visible && !actionLinks[k].actionObj.hideOnMobile &&