diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 34f9a54f2..55fd4dd77 100644 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -16,10 +16,8 @@ ThreadHiding = $.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide' onrefresh: -> - for threadID, thread of g.BOARD.threads when thread.isHidden - hasStub = !!thread.stub - ThreadHiding.show thread - ThreadHiding.hide thread, hasStub + for threadID, thread of g.BOARD.threads when thread.isHidden and thread.stub + $.prepend thread.OP.nodes.root.parentNode, thread.stub return syncCatalog: -> diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 5c75dff8e..74b40338b 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -271,6 +271,16 @@ Build = thread: (board, data) -> Build.spoilerRange[board] = data.custom_spoiler + if (OP = board.posts[data.no]) and parent = OP.nodes.root.parentNode + root = parent + hr = parent.nextElementSibling + $.rmAll root + else + root = $.el 'div', + className: 'thread' + id: "t#{data.no}" + hr = $.el 'hr' + nodes = [] for obj in [data].concat data.last_replies or [] nodes.push if post = board.posts[obj.no] @@ -282,8 +292,5 @@ Build = if data.omitted_posts nodes.splice 1, 0, Build.summary board.ID, data.no, data.omitted_posts, data.omitted_images - root = $.el 'div', - className: 'thread' - id: "t#{data.no}" $.add root, nodes - root + [root, hr] diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 5946e0e5f..5f66c0f40 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -188,8 +188,8 @@ Index = threads = [] posts = [] for threadData in Index.liveThreadData - threadRoot = Build.thread g.BOARD, threadData - Index.nodes.push threadRoot, $.el 'hr' + [threadRoot, hr] = Build.thread g.BOARD, threadData + Index.nodes.push threadRoot, hr if thread = g.BOARD.threads[threadData.no] thread.setStatus 'Sticky', !!threadData.sticky thread.setStatus 'Closed', !!threadData.closed @@ -250,6 +250,6 @@ Index = nodes = Index.sortedNodes[nodesPerPage * pageNum ... nodesPerPage * (pageNum + 1)] else nodes = Index.sortedNodes - $.event 'IndexRefresh' $.rmAll Index.root + $.event 'IndexRefresh' $.add Index.root, nodes