Module:NavboxMobile: Difference between revisions

No edit summary
No edit summary
Line 195: Line 195:
-- Function to render the navigation bar
-- Function to render the navigation bar
local function renderNavBar(cell)
local function renderNavBar(cell)
    local spacerSide = nil
     if args.navbar == 'off' then
     if args.navbar == 'off' then
         if args.state == 'plain' then spacerSide = 'right' end
         return -- Don't render anything if Navbar is off
    elseif args.navbar == 'plain' or (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/sandbox$', '') == 'Template:navbox') then
        if args.state ~= 'plain' then spacerSide = 'left' end
    else
        if args.state == 'plain' then spacerSide = 'right' end
 
        cell:wikitext(navbar{
            args.name,
            mini = 1,
            fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') ..  ';background:none transparent;border:none;'
        })
     end
     end


     if spacerSide then
     -- Render the Navbar
        cell
    cell:wikitext(navbar{
            :tag('span')
        args.name,
                :css('float', spacerSide)
        mini = 1,
                :css('width', '6em')
        fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;'
                :wikitext(' ')
     })
     end
end
end


--
--