diff --git a/src/General/Build.coffee b/src/General/Build.coffee index d70d877bd..398492bcb 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -175,8 +175,7 @@ Build = $.rmAll root if thread.nodes.placeholder thread.nodes.placeholder = null - $.rmClass thread.OP.nodes.root, 'catalog-postContainer' - $.rmClass thread.OP.nodes.post, 'catalog-post' + thread.OP.setCatalogOP false else thread.nodes.root = root = $.el 'div', className: 'thread' diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 56c2803ea..08a51056e 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -781,8 +781,7 @@ Index = if thread.nodes.placeholder $.replace thread.nodes.placeholder, thread.OP.nodes.root thread.nodes.placeholder = null - $.rmClass thread.OP.nodes.root, 'catalog-postContainer' - $.rmClass thread.OP.nodes.post, 'catalog-post' + thread.OP.setCatalogOP false if (file = thread.OP.file) and (thumb = thread.OP.file.thumb) and thumb.dataset.src thumb.src = thumb.dataset.src # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 @@ -802,8 +801,7 @@ Index = thread.nodes.placeholder = $.el 'div' $.replace thread.OP.nodes.root, thread.nodes.placeholder $.add thread.catalogView.nodes.root, thread.OP.nodes.root - $.addClass thread.OP.nodes.root, 'catalog-postContainer' - $.addClass thread.OP.nodes.post, 'catalog-post' + thread.OP.setCatalogOP true nodes.push thread.catalogView.nodes.root $.add Index.root, nodes if doc.contains Index.root diff --git a/src/classes/Post.Clone.coffee b/src/classes/Post.Clone.coffee index 97a520adf..c41d862c1 100644 --- a/src/classes/Post.Clone.coffee +++ b/src/classes/Post.Clone.coffee @@ -29,11 +29,11 @@ Post.Clone = class extends Post $.rmClass @nodes.post, 'highlight' # keybind navigation, ID highlighting # Remove catalog stuff. - $.rmClass @nodes.root, 'catalog-postContainer' - $.rmClass @nodes.post, 'catalog-post' - $.rm $('.catalog-link', @nodes.post) - $.rm $('.catalog-stats', @nodes.post) - $.rm $('.catalog-replies', @nodes.post) + unless @isReply + @setCatalogOP false + $.rm $('.catalog-link', @nodes.post) + $.rm $('.catalog-stats', @nodes.post) + $.rm $('.catalog-replies', @nodes.post) @parseQuotes() @quotes = [@origin.quotes...] diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee index fef518036..94f8b0e2b 100644 --- a/src/classes/Post.coffee +++ b/src/classes/Post.coffee @@ -258,3 +258,7 @@ class Post for clone in @clones[index..] clone.nodes.root.dataset.clone = index++ return + + setCatalogOP: (isCatalogOP) -> + @nodes.root.classList.toggle 'catalog-postContainer', isCatalogOP + @nodes.post.classList.toggle 'catalog-post', isCatalogOP