Shift+click to hide threads in the catalog.

This commit is contained in:
Mayhem 2014-01-28 09:59:49 +01:00
parent a8002930f4
commit 1d43fbc498
4 changed files with 15 additions and 3 deletions

View File

@ -110,7 +110,8 @@ Filter =
# Highlight
$.addClass @nodes.root, result.class
@thread.highlight = result.class
unless result.class in @highlights
(@highlights or= []).push result.class
if !@isReply and result.top
@thread.isOnTop = true

View File

@ -1,6 +1,6 @@
ThreadHiding =
init: ->
return if g.VIEW isnt 'index' or !Conf['Thread Hiding'] and !Conf['Thread Hiding Link']
return if g.VIEW isnt 'index'
@db = new DataBoard 'hiddenThreads'
@syncCatalog()

View File

@ -297,7 +297,7 @@ Build =
className: 'catalog-thread'
innerHTML: <%= importHTML('General/Thread-catalog-view') %>
$.addClass root, thread.highlight if thread.highlight
$.addClass root, thread.OP.highlights... if thread.OP.highlights
if thread.isSticky
$.add $('.thread-icons', root), $.el 'img',

View File

@ -53,6 +53,17 @@ class Thread
getCatalogView: ->
return @catalogView if @catalogView
@catalogView = Build.threadCatalog @
$.on $('.thumb', @catalogView), 'click', @onCatalogViewClick
@catalogView
onCatalogViewClick: (e) =>
return if e.button isnt 0
if e.shiftKey
$.rm @catalogView
ThreadHiding.hide @
ThreadHiding.saveHiddenState @
else
return
e.preventDefault()
kill: ->
@isDead = true