Remove [Catalog] links in threads.

This commit is contained in:
Mayhem 2014-01-29 16:40:34 +01:00
parent 1aa467b051
commit b05fa8159f
2 changed files with 17 additions and 1 deletions

View File

@ -378,6 +378,11 @@ a[href="javascript:;"] {
:root.index-loading .pagelist {
display: none;
}
:root.removing-catalog-links .navLinks {
/* can't `display:none;` the text node next to the link,
so we hide the container instead. */
visibility: hidden;
}
#index-search {
padding-right: 1.5em;
width: 100px;

View File

@ -1,6 +1,10 @@
Index =
init: ->
return if g.VIEW isnt 'index' or g.BOARD.ID is 'f'
if g.VIEW isnt 'index'
@rmCatalogLinks()
return
return if g.BOARD.ID is 'f'
@db = new DataBoard 'pinnedThreads'
Thread.callbacks.push
@ -142,6 +146,13 @@ Index =
val: isPinned: thread.isPinned
Index.sort()
Index.buildIndex()
rmCatalogLinks: ->
$.addClass doc, 'removing-catalog-links'
$.ready ->
for el in $$ '.navLinks a[href$=catalog]'
$.rm el.previousSibling
$.rm el
$.rmClass doc, 'removing-catalog-links'
cb:
rootClass: ->