Module:NavboxMobile: Difference between revisions

No edit summary
No edit summary
Tag: Reverted
Line 283: Line 283:
end
end


-- Revised renderListRow Function
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
            -- Define styles for different levels
            local groupStyles = {
                [2] = "padding: 0.5em; background-color: #e6e6ff; box-shadow: inset 5px 0 #fff, inset -5px 0 #fff;",
                [3] = "padding: 0.5em; background-color: #f0f0ff; box-shadow: inset 5px 0 #ddd, inset -5px 0 #ddd;"
            }
             -- Add a level-specific class to the group row
             -- Add a level-specific class to the group row
             local groupRow = addTableRow(tbl)
             local groupRow = addTableRow(tbl)
Line 300: Line 304:
                 :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
                :cssText(groupStyles[parentLevel] or "") -- Apply inline styles based on level
                 :wikitext(processItem(args[groupKey]))
                 :wikitext(processItem(args[groupKey]))