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