Module:MaterialInfobox: Difference between revisions
Content deleted Content added
That last edit worked, so let's rename that helper function and do it for values as well. |
A bit of a hack so we don't have to rewrite functions for Infobox Splits |
||
Line 35:
end
function SplitRunFunction(func_name,
if type( func_name ) == "string" then
if not HF.isempty( func_name ) then
if type( Infobox[func_name] ) == "function" then
return Infobox[func_name](
end
end
Line 48:
function Infobox.SplitLabelMethod( field, vars )
return {
SplitRunFunction( field.LabelLeftMethod, field
SplitRunFunction( field.LabelRightMethod, field
}
end
function Infobox.SplitValueMethod( field, vars )
field.Value = ValueLeft --[[ A bit hacky, but it's about to be replaced by this function's output anyways, and if it works, then we don't need special functions for Splits ]]--
local ValueLeft = SplitRunFunction( field.ValueLeftMethod, field, vars )
field.Value = ValueRight
local ValueRight = SplitRunFunction( field.ValueRightMethod, field, vars )
return {
}
end
| |||