Module:Tabs: Difference between revisions

12 bytes added ,  Sunday at 20:52
no edit summary
No edit summary
No edit summary
Line 40: Line 40:
local contents = mw.html.create( 'div' ):addClass('g-tab-contents')
local contents = mw.html.create( 'div' ):addClass('g-tab-contents')
repeat
repeat
tab = mw.html.create( 'span' ):addClass('g-tab'):wikitext(args[i+1])
tab = mw.html.create( 'span' ):addClass('g-tab'):wikitext(trim(args[i+1]))
tabcontent = mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(args[i+2])
tabcontent = mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(trim(args[i+2]))
if active == (i + 2) * 0.5 then
if active == (i + 2) * 0.5 then
tab = tab:addClass('g-tab-active')
tab = tab:addClass('g-tab-active')