diff --git a/src/General/Get.coffee b/src/General/Get.coffee index b9ff94909..91b85f3e2 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -10,7 +10,7 @@ Get = excerpt threadFromRoot: (root) -> return null unless root? - g.threads["#{g.BOARD}.#{root.id.match(/\d*$/)[0]}"] + g.threads["#{root.dataset.board or g.BOARD.ID}.#{root.id.match(/\d*$/)[0]}"] threadFromNode: (node) -> Get.threadFromRoot $.x "ancestor-or-self::#{Site.xpath.thread}", node postFromRoot: (root) -> diff --git a/src/main/Main.coffee b/src/main/Main.coffee index b97326808..532201a63 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -304,14 +304,18 @@ Main = posts = [] for threadRoot in $$(s.thread, board) - thread = new Thread +threadRoot.id.match(/\d*$/)[0], g.BOARD + boardObj = if (boardID = threadRoot.dataset.board) + g.boards[boardID] or new Board(boardID) + else + g.BOARD + thread = new Thread +threadRoot.id.match(/\d*$/)[0], boardObj thread.nodes.root = threadRoot threads.push thread postRoots = $$ s.postContainer, threadRoot postRoots.unshift threadRoot if Site.isOPContainerThread for postRoot in postRoots when $(s.comment, postRoot) try - posts.push new Post postRoot, thread, g.BOARD + posts.push new Post postRoot, thread, thread.board catch err # Skip posts that we failed to parse. unless errors