Modul:Sidebar: Unterschied zwischen den Versionen
allow for #invoke with args
imported>Toohool (fix duplicated rows) |
imported>Toohool (allow for #invoke with args) |
||
Zeile 192: | Zeile 192: | ||
function p.sidebar(frame) | function p.sidebar(frame) | ||
local origArgs | local origArgs | ||
if frame == mw.getCurrentFrame() then | if frame == mw.getCurrentFrame() then | ||
-- We're being called via #invoke. If the invoking template passed any args, use | |||
-- them. Otherwise, use the args that were passed into the template. | |||
origArgs = frame:getParent().args | origArgs = frame:getParent().args | ||
for k, v in pairs(frame.args) do | |||
origArgs = frame.args | |||
break | |||
end | |||
else | else | ||
-- We're being called from another module or from the debug console, so assume | |||
-- the args are passed in directly. | |||
origArgs = frame | origArgs = frame | ||
end | end |