Update thread post/file count on index refresh in the catalog.
This commit is contained in:
parent
efd28e8ae4
commit
bdf2b4a6ba
@ -294,6 +294,8 @@ Index =
|
|||||||
Index.nodes.push threadRoot, $.el 'hr'
|
Index.nodes.push threadRoot, $.el 'hr'
|
||||||
if thread = g.BOARD.threads[threadData.no]
|
if thread = g.BOARD.threads[threadData.no]
|
||||||
thread.setPage Math.floor i / Index.threadsNumPerPage
|
thread.setPage Math.floor i / Index.threadsNumPerPage
|
||||||
|
thread.setCount 'post', threadData.replies + 1, threadData.bumplimit
|
||||||
|
thread.setCount 'file', threadData.images + !!threadData.ext, threadData.imagelimit
|
||||||
thread.setStatus 'Sticky', !!threadData.sticky
|
thread.setStatus 'Sticky', !!threadData.sticky
|
||||||
thread.setStatus 'Closed', !!threadData.closed
|
thread.setStatus 'Closed', !!threadData.closed
|
||||||
else
|
else
|
||||||
|
|||||||
@ -17,6 +17,11 @@ class Thread
|
|||||||
for key in ['title', 'textContent']
|
for key in ['title', 'textContent']
|
||||||
icon[key] = icon[key].replace /\d+/, pageNum
|
icon[key] = icon[key].replace /\d+/, pageNum
|
||||||
$('.page-count', @catalogView).textContent = pageNum if @catalogView
|
$('.page-count', @catalogView).textContent = pageNum if @catalogView
|
||||||
|
setCount: (type, count, reachedLimit) ->
|
||||||
|
return unless @catalogView
|
||||||
|
el = $ ".#{type}-count", @catalogView
|
||||||
|
el.textContent = count
|
||||||
|
(if reachedLimit then $.addClass else $.rmClass) el, 'warning'
|
||||||
setStatus: (type, status) ->
|
setStatus: (type, status) ->
|
||||||
name = "is#{type}"
|
name = "is#{type}"
|
||||||
return if @[name] is status
|
return if @[name] is status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user