Changes
Jump to navigation
Jump to search
addStateLinkPlaceholder = (args.state == 'plain')
fix title centering
function renderNavBar(titleCell)
-- Depending on the presence of the navbar and/or show/hide link, we may need to add a spacer div on the left -- or right to keep the title centered. local addStateLinkPlaceholder spacerSide = falsenil if args.navbar == 'off' then -- No navbar, and client wants no spacer, i.e. wants the title to be shifted to the left. If there's -- also no show/hide link, then we need a spacer on the right to achieve the left shift. if args.state == 'plain' then spacerSide = 'right' end elseif args.navbar == 'plain' or args.navbar == 'off' or (not args.name and (border == 'subgroup' or border == 'child' or border == 'none')) then if args-- No navbar. Need a spacer on the left to balance out the width of the show/hide link.navbar == 'off' then addStateLinkPlaceholder = ( if args.state =~= 'plain') else addStateLinkPlaceholder = (args.state ~then spacerSide = 'plainleft') end
else
-- Will render navbar (or error message). If there's no show/hide link, need a spacer on the right
-- to balance out the width of the navbar.
if args.state == 'plain' then spacerSide = 'right' end
if args.name then
titleCell.wikitext(mw.getCurrentFrame():expandTemplate{ title = 'navbar', args = {
.css('white-space', 'nowrap')
.wikitext('Error: No name provided')
end
end
-- Render the spacer div. if addStateLinkPlaceholder spacerSide then
titleCell
.tag('span')
.css('float', 'right'spacerSide)
.css('width', '6em')
.wikitext(' ')