Module:Navbox: Difference between revisions
don't need a special function for the list1 row, and fix for border=none
m>Toohool (fix title centering) |
m>Toohool (don't need a special function for the list1 row, and fix for border=none) |
||
Line 168: | Line 168: | ||
-- List rows | -- List rows | ||
-- | -- | ||
function | function renderListRow(tbl, listnum) | ||
local row = addTableRow(tbl) | local row = addTableRow(tbl) | ||
if args.imageleft then | if listnum == 1 and args.imageleft then | ||
row | row | ||
.tag('td') | .tag('td') | ||
Line 187: | Line 185: | ||
end | end | ||
if args['group' .. listnum] then | if args['group' .. listnum] then | ||
local groupCell = row.tag('th') | local groupCell = row.tag('th') | ||
Line 312: | Line 242: | ||
.newline() | .newline() | ||
.wikitext(args['list' .. listnum]) | .wikitext(args['list' .. listnum]) | ||
if listnum == 1 and args.image then | |||
row | |||
.tag('td') | |||
.addClass('navbox-image') | |||
.addClass(args.imageclass) | |||
.css('width', '0%') | |||
.css('padding', '0px 0px 0px 2px') | |||
.cssText(args.imagestyle) | |||
.attr('rowspan', 2 * #listnums - 1) | |||
.tag('div') | |||
.newline() | |||
.wikitext(args.image) | |||
end | |||
end | end | ||
Line 346: | Line 290: | ||
renderTitleRow(tbl) | renderTitleRow(tbl) | ||
renderAboveRow(tbl) | renderAboveRow(tbl) | ||
for i, listnum in ipairs(listnums) do | for i, listnum in ipairs(listnums) do | ||
renderListRow(tbl, listnum) | |||
end | end | ||
renderBelowRow(tbl) | renderBelowRow(tbl) | ||
Line 394: | Line 332: | ||
.css('padding', '2px') | .css('padding', '2px') | ||
.node(tbl) | .node(tbl) | ||
else -- border == 'none' | |||
res.node(tbl) | |||
end | end | ||