Hiding threads should be able to hide other posts recursively too.

This commit is contained in:
Mayhem 2014-02-19 05:06:03 +01:00
parent 498dfda2ef
commit ab2ea29dd6

View File

@ -163,17 +163,19 @@ class Post
@labels.push label unless label in @labels
return if @isHidden
@isHidden = true
for quotelink in Get.allQuotelinksLinkingTo @
$.addClass quotelink, 'filtered'
if !@isReply
@thread.hide()
return
if hideRecursively
label = "Recursively hidden for quoting No.#{@}"
Recursive.apply 'hide', @, label, makeStub, true
Recursive.add 'hide', @, label, makeStub, true
if !@isReply
@thread.hide()
return
unless makeStub
@nodes.root.hidden = true
return
@ -194,16 +196,18 @@ class Post
@labels = @labels.filter (label) ->
# This is lame.
!/^(Manually hidden|Recursively hidden|Hidden by)/.test label
for quotelink in Get.allQuotelinksLinkingTo @
$.rmClass quotelink, 'filtered'
if !@isReply
@thread.show()
return
if showRecursively
Recursive.apply 'show', @, true
Recursive.rm 'hide', @
if !@isReply
@thread.show()
return
unless @nodes.stub
@nodes.root.hidden = false
return