From efd28e8ae42dba993dd48b425dce3c928160b7e6 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sun, 26 Jan 2014 17:02:55 +0100 Subject: [PATCH] Update page/sticky/closed status on index refresh for the catalog. --- src/General/Thread.coffee | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/General/Thread.coffee b/src/General/Thread.coffee index d7dd92fa3..0ab71f599 100644 --- a/src/General/Thread.coffee +++ b/src/General/Thread.coffee @@ -16,7 +16,7 @@ class Thread icon = $ '.page-num', @OP.nodes.post for key in ['title', 'textContent'] icon[key] = icon[key].replace /\d+/, pageNum - return + $('.page-count', @catalogView).textContent = pageNum if @catalogView setStatus: (type, status) -> name = "is#{type}" return if @[name] is status @@ -25,20 +25,26 @@ class Thread typeLC = type.toLowerCase() unless status $.rm $ ".#{typeLC}Icon", @OP.nodes.info + $.rm $ ".#{typeLC}Icon", @catalogView if @catalogView return + icon = $.el 'img', - src: "//s.4cdn.org/image/#{typeLC}#{if window.devicePixelRatio >= 2 then '@2x' else ''}.gif" + src: "#{Build.staticPath}#{typeLC}#{Build.gifIcon}" alt: type title: type className: "#{typeLC}Icon" root = if type is 'Closed' and @isSticky $ '.stickyIcon', @OP.nodes.info else if g.VIEW is 'index' - $ '.page-num', @OP.nodes.info + $ '.page-num', @OP.nodes.info else $ '[title="Quote this post"]', @OP.nodes.info $.after root, [$.tn(' '), icon] + return unless @catalogView + root = $ '.thread-icons', @catalogView + (if type is 'Sticky' and @isClosed then $.prepend else $.add) root, icon.cloneNode() + getCatalogView: -> return @catalogView if @catalogView @catalogView = Build.threadCatalog @