Module:Navbox with collapsible groups: Difference between revisions
problem found: Module:Navbox is not re-entry safe due to listnums not being reset
No edit summary |
(problem found: Module:Navbox is not re-entry safe due to listnums not being reset) |
||
Line 21: | Line 21: | ||
function q._navbox(pargs) | function q._navbox(pargs) | ||
-- table for args passed to navbox | -- table for args passed to navbox | ||
local targs = {} | local targs = {} | ||
Line 71: | Line 69: | ||
local state = (pargs['abbr' .. n] and pargs['abbr' .. n] == pargs['selected']) | local state = (pargs['abbr' .. n] and pargs['abbr' .. n] == pargs['selected']) | ||
and 'uncollapsed' or pargs['state' .. n] or 'collapsed' | and 'uncollapsed' or pargs['state' .. n] or 'collapsed' | ||
targs['list' .. n] = Navbox( | |||
{'child', navbar = 'plain', state = state, | |||
basestyle = pargs['basestyle'], | basestyle = pargs['basestyle'], | ||
title = title, titlestyle = titlestyle, | title = title, titlestyle = titlestyle, | ||
Line 78: | Line 78: | ||
image = pargs['image' .. n], | image = pargs['image' .. n], | ||
imageleft = pargs['imageleft' .. n], | imageleft = pargs['imageleft' .. n], | ||
listpadding = pargs['listpadding']} | listpadding = pargs['listpadding']}) | ||
end | end | ||
end | end | ||
Line 92: | Line 86: | ||
-- child or subgroup | -- child or subgroup | ||
if targs['border'] == nil then targs['border'] = pargs[1] end | if targs['border'] == nil then targs['border'] = pargs[1] end | ||
return Navbox(targs) | return Navbox(targs) | ||
end | end | ||
function q.navbox(frame) | function q.navbox(frame) | ||
local pargs = require('Module:Arguments').getArgs(frame, {wrappers = {'Template:Navbox with collapsible groups'}}) | local pargs = require('Module:Arguments').getArgs(frame, {wrappers = {'Template:Navbox with collapsible groups'}}) | ||