Module:NavboxMobile: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 283: | Line 283: | ||
end | end | ||
local function renderListRow(tbl, path, parentLevel) | local function renderListRow(tbl, path, parentLevel) | ||
path = path or "" | path = path or "" | ||
Line 293: | Line 292: | ||
if args[groupKey] then | if args[groupKey] then | ||
-- Add custom inline styles | -- Add custom inline styles for group headings | ||
local | local groupInlineStyles = "" | ||
if parentLevel == 2 then | if parentLevel == 2 then | ||
groupInlineStyles = "box-shadow: inset 5px 0 #fff, inset -5px 0 #fff;" | |||
elseif parentLevel == 3 then | elseif parentLevel == 3 then | ||
groupInlineStyles = "box-shadow: inset 10px 0 #fff, inset -10px 0 #fff;" | |||
end | end | ||
Line 306: | Line 305: | ||
:attr('scope', 'row') | :attr('scope', 'row') | ||
:addClass('navboxMobile-group-content') | :addClass('navboxMobile-group-content') | ||
:addClass('navboxMobile-group-level' .. parentLevel) | :addClass('navboxMobile-group-level' .. parentLevel) | ||
:attr('data-level', parentLevel) | :attr('data-level', parentLevel) | ||
:cssText( | :cssText(groupInlineStyles) | ||
:wikitext(processItem(args[groupKey])) | :wikitext(processItem(args[groupKey])) | ||
Line 317: | Line 316: | ||
:attr('colspan', 2) | :attr('colspan', 2) | ||
:addClass('navboxMobile-list-content') | :addClass('navboxMobile-list-content') | ||
:addClass('navboxMobile-list-level' .. parentLevel) | :addClass('navboxMobile-list-level' .. parentLevel) | ||
:addClass((i % 2 == 1) and 'navboxMobile-odd' or 'navboxMobile-even') | :addClass((i % 2 == 1) and 'navboxMobile-odd' or 'navboxMobile-even') | ||
:css('padding', '0 0.25em') | :css('padding', '0 0.25em') | ||
:css('width', parentLevel == 2 and '95%' or '90%') -- Adjust width for narrowing | :css('width', parentLevel == 2 and '95%' or '90%') -- Adjust width for narrowing | ||
: | |||
-- Add box shadow for list contents | |||
local listInlineStyles = "" | |||
if parentLevel == 2 then | |||
listInlineStyles = "box-shadow: inset 5px 0 #fff, inset -5px 0 #fff;" | |||
elseif parentLevel == 3 then | |||
listInlineStyles = "box-shadow: inset 10px 0 #fff, inset -10px 0 #fff;" | |||
end | |||
listCell:cssText(listInlineStyles) | |||
if args[listKey] == 'child' then | if args[listKey] == 'child' then | ||
Line 336: | Line 342: | ||
end | end | ||
end | end | ||