Make custom 'current' board links work on unlisted boards.

This commit is contained in:
ccd0 2015-01-23 12:20:22 -08:00
parent f80eb87dc6
commit 9693ea5821

View File

@ -207,14 +207,22 @@ Header =
g.BOARD.ID
else
t.match(/^[^-]+/)[0]
for a in as
if a.textContent is boardID
a = a.cloneNode true
for aOrig in as
if aOrig.textContent is boardID
a = aOrig.cloneNode true
if !a
if /^current/.test t
a = $.el 'a',
href: "/#{boardID}/"
textContent: boardID
else
return $.tn t
a.textContent = if /-title/.test(t) or /-replace/.test(t) and $.hasClass a, 'current'
a.title
a.title or a.textContent
else if /-full/.test t
"/#{boardID}/ - #{a.title}"
"/#{boardID}/" + (if a.title then " - #{a.title}" else '')
else if text
text
else
@ -239,7 +247,7 @@ Header =
$.addClass a, 'navSmall' if boardID is '@'
return a
$.tn t
$.add list, nodes
$.ready CatalogLinks.initBoardList