Module:Navbox: Difference between revisions
m 1 revision imported |
Remove redundant arghash calculation |
||
Line 579: | Line 579: | ||
) | ) | ||
else | else | ||
nav:attr('aria-label', cfg.aria_label) | nav:attr('aria-label', cfg.aria_label .. args.argHash) | ||
end | end | ||
elseif border == cfg.keyword.border_subgroup then | elseif border == cfg.keyword.border_subgroup then | ||
Line 854: | Line 854: | ||
-- Read the arguments in the order they'll be output in, to make references | -- Read the arguments in the order they'll be output in, to make references | ||
-- number in the right order. | -- number in the right order. | ||
local _ | local _ | ||
_ = | _ = args[prefix .. cfg.arg.title] | ||
_ = | _ = args[prefix .. cfg.arg.above] | ||
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because | -- Limit this to 20 as covering 'most' cases (that's a SWAG) and because | ||
-- iterator approach won't work here | -- iterator approach won't work here | ||
for i = 1, 20 do | for i = 1, 20 do | ||
_ = | _ = args[prefix .. andnum('group', i)] | ||
if inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then | if inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then | ||
for _, v in ipairs(cfg.arg.subgroups_and_num) do | for _, v in ipairs(cfg.arg.subgroups_and_num) do | ||
Line 868: | Line 868: | ||
end | end | ||
end | end | ||
_ = | _ = args[prefix .. cfg.arg.below] | ||
end | end | ||
Line 876: | Line 875: | ||
end | end | ||
local args = getArgs(frame, {wrappers = {cfg.pattern[boxtype or 'navbox']}}) | local args = getArgs(frame, {wrappers = {cfg.pattern[boxtype or 'navbox']}}) | ||
readArgs(args, "") | |||
args.argHash = nil -- we shouldn't accept argHash passed from a template | |||
args.type = args.type or cfg.keyword[boxtype] | args.type = args.type or cfg.keyword[boxtype] | ||
return p['_navbox'](args) | return p['_navbox'](args) |