Module:Sandbox/Dat Hack3r: Difference between revisions
Appearance
Dat Hack3r (talk | contribs) Fixed overly-limited scope of "curr_num". |
Dat Hack3r (talk | contribs) m Integrated "prepad" and "postpad" for seamless hidden spacing in navigation. |
||
Line 15: | Line 15: | ||
local navlist = {} | local navlist = {} | ||
local prepad = '' | |||
local postpad = '' | |||
for i=curr_num - 5,curr_num + 5 do | for i=curr_num - 5,curr_num + 5 do | ||
if i < s_start then | if i < s_start then | ||
prepad = prepad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | |||
elseif i > s_end then | |||
postpad = postpad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | |||
else | else | ||
if mw.title.new(string.format(title_format, i), title.namespace).exists then | if mw.title.new(string.format(title_format, i), title.namespace).exists then | ||
Line 31: | Line 35: | ||
args = {src = 'Module:Series navigation/styles.css'} | args = {src = 'Module:Series navigation/styles.css'} | ||
} | } | ||
return templatestyles..'<div class="toccolours seriesNavigation" role="navigation" aria-label="Range">'..horizontal(navlist)..'</div>' | return templatestyles..'<div class="toccolours seriesNavigation" role="navigation" aria-label="Range">'..prepad..horizontal(navlist)..postpad..'</div>' | ||
end | end | ||