Fix issues with thread stubs on Tinyboard/vichan.
This commit is contained in:
parent
9e096d72d8
commit
3151f3c276
@ -49,12 +49,12 @@ ThreadHiding =
|
||||
node: ->
|
||||
return if @isReply or @isClone or @isFetchedQuote
|
||||
|
||||
if Conf['Thread Hiding Buttons']
|
||||
$.prepend @nodes.root, ThreadHiding.makeButton(@thread, 'hide')
|
||||
|
||||
if data = ThreadHiding.db.get {boardID: @board.ID, threadID: @ID}
|
||||
ThreadHiding.hide @thread, data.makeStub
|
||||
|
||||
return unless Conf['Thread Hiding Buttons']
|
||||
$.prepend @nodes.root, ThreadHiding.makeButton(@thread, 'hide')
|
||||
|
||||
onIndexRefresh: ->
|
||||
g.BOARD.threads.forEach (thread) ->
|
||||
{root} = thread.nodes
|
||||
@ -143,9 +143,10 @@ ThreadHiding =
|
||||
a.dataset.fullID = thread.fullID
|
||||
$.on a, 'click', ThreadHiding.toggle
|
||||
a
|
||||
|
||||
makeStub: (thread, root) ->
|
||||
numReplies = $$('.thread > .replyContainer', root).length
|
||||
numReplies += +summary.textContent.match /\d+/ if summary = $ '.summary', root
|
||||
numReplies = $$(Site.selectors.postContainer + Site.selectors.relative.replyPost, root).length
|
||||
numReplies += +summary.textContent.match /\d+/ if summary = $ Site.selectors.summary, root
|
||||
|
||||
a = ThreadHiding.makeButton thread, 'show'
|
||||
$.add a, $.tn " #{thread.OP.info.nameBlock} (#{if numReplies is 1 then '1 reply' else "#{numReplies} replies"})"
|
||||
@ -157,6 +158,10 @@ ThreadHiding =
|
||||
$.add thread.stub, a
|
||||
$.prepend root, thread.stub
|
||||
|
||||
# Prevent hiding of thread divider on sites that put it inside the thread
|
||||
if (threadDivider = $ Site.selectors.threadDivider, root)
|
||||
$.addClass threadDivider, 'threadDivider'
|
||||
|
||||
saveHiddenState: (thread, makeStub) ->
|
||||
if thread.isHidden
|
||||
ThreadHiding.db.set
|
||||
|
||||
@ -1517,7 +1517,7 @@ input[name="Default Volume"] {
|
||||
margin-top: -1px;
|
||||
width: 11px;
|
||||
}
|
||||
.stub ~ * {
|
||||
.stub ~ :not(.threadDivider) {
|
||||
display: none !important;
|
||||
}
|
||||
.stub input {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user