Module:NavboxMobile: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 295: | Line 295: | ||
if args[groupKey] then | if args[groupKey] then | ||
-- Render the group (heading) | -- Render the group (heading) | ||
local groupRow = addTableRow(tbl) | local groupRow = addTableRow(tbl) | ||
Line 305: | Line 302: | ||
:addClass('navboxMobile-group-level' .. parentLevel) -- Level-specific class | :addClass('navboxMobile-group-level' .. parentLevel) -- Level-specific class | ||
:attr('data-level', parentLevel) -- Optional attribute for CSS targeting | :attr('data-level', parentLevel) -- Optional attribute for CSS targeting | ||
:wikitext(processItem(args[groupKey])) | :wikitext(processItem(args[groupKey])) | ||
Line 313: | Line 309: | ||
local listCell = listRow:tag('td') | local listCell = listRow:tag('td') | ||
:attr('colspan', 2) | :attr('colspan', 2) | ||
:addClass('navboxMobile-list-content') | :addClass('navboxMobile-list-content') -- Base content class | ||
:addClass('navboxMobile-list-level' .. parentLevel) -- Level-specific class | :addClass('navboxMobile-list-level' .. parentLevel) -- Level-specific class | ||
:addClass((i % 2 == 1) and 'navboxMobile-odd' or 'navboxMobile-even') | :addClass((i % 2 == 1) and 'navboxMobile-odd' or 'navboxMobile-even') -- Odd/even styling | ||
: | :addClass('hlist') -- Maintain hlist styling | ||
:wikitext(processItem(args[listKey], args.nowrapitems)) | |||
: | |||
if args[listKey] == 'child' then | if args[listKey] == 'child' then | ||
local newPath = (path ~= "" and path .. "_" or "") .. i | local newPath = (path ~= "" and path .. "_" or "") .. i | ||
renderListRow(tbl, tostring(newPath), parentLevel + 1) | renderListRow(tbl, tostring(newPath), parentLevel + 1) | ||
end | end | ||
end | end | ||
Line 333: | Line 323: | ||
end | end | ||
end | end | ||