Module:NavboxMobile: Difference between revisions

No edit summary
No edit summary
Line 537: Line 537:
         -- Wrap the table within a navigation div with ARIA attributes
         -- Wrap the table within a navigation div with ARIA attributes
         local navWrapper = mw.html.create('div')
         local navWrapper = mw.html.create('div')
            :addClass('navboxMobile-container') -- Add consistent container
             :attr('role', 'navigation')
             :attr('role', 'navigation')
         if args.title or args.above or (args.group1 and not args.group2) then
         if args.title or args.above or (args.group1 and not args.group2) then
Line 551: Line 552:
         -- Assume this navboxMobile is inside a parent navboxMobile's list cell
         -- Assume this navboxMobile is inside a parent navboxMobile's list cell
         -- Insert closing and opening divs to manage padding
         -- Insert closing and opening divs to manage padding
         res
         local subgroupWrapper = mw.html.create('div')
             :wikitext('</div>') -- Close parent div
             :addClass('navboxMobile-container') -- Consistent wrapping container
             :node(tbl)
             :node(tbl) -- Add the table as a child
            :wikitext('<div>') -- Reopen parent div
 
        res:node(subgroupWrapper)
     else
     else
         -- Wrap the table within a navigation div with additional classes and styles
         -- Wrap the table within a navigation div with additional classes and styles
         local navWrapper = mw.html.create('div')
         local navWrapper = mw.html.create('div')
            :addClass('navboxMobile-container') -- Add consistent container
             :attr('role', 'navigation')
             :attr('role', 'navigation')
             :addClass('navboxMobile') -- Add appropriate classes
             :addClass('navboxMobile') -- Add appropriate classes