Module:Tabs: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 15: Line 15:
local contents = mw.html.create( 'div' ):addClass('g-tab-contents')
local contents = mw.html.create( 'div' ):addClass('g-tab-contents')
repeat
repeat
header = header:node(mw.html.create( 'span' ):addClass('g-tab'):wikitext(args[i+2]))
tab = mw.html.create( 'span' ):addClass('g-tab'):wikitext(args[i+2])
if active == (i + 2) * 0.5 then
if active == (i + 2) * 0.5 then
header = header:addClass('g-tab-active')
tab = tab:addClass('g-tab-active')
end
end
header = header:node(tab)
contents = contents:node(mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(args[i+1]))
contents = contents:node(mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(args[i+1]))
i = i + 2
i = i + 2