Add thread.nodes.root property.
This commit is contained in:
parent
3997cf354d
commit
8a6b6b5ec8
@ -175,7 +175,7 @@ ThreadHiding =
|
|||||||
|
|
||||||
hide: (thread, makeStub=Conf['Stubs']) ->
|
hide: (thread, makeStub=Conf['Stubs']) ->
|
||||||
return if thread.isHidden
|
return if thread.isHidden
|
||||||
threadRoot = thread.OP.nodes.root.parentNode
|
threadRoot = thread.nodes.root
|
||||||
thread.isHidden = true
|
thread.isHidden = true
|
||||||
Index.updateHideLabel() if Conf['JSON Index']
|
Index.updateHideLabel() if Conf['JSON Index']
|
||||||
|
|
||||||
@ -187,6 +187,6 @@ ThreadHiding =
|
|||||||
if thread.stub
|
if thread.stub
|
||||||
$.rm thread.stub
|
$.rm thread.stub
|
||||||
delete thread.stub
|
delete thread.stub
|
||||||
threadRoot = thread.OP.nodes.root.parentNode
|
threadRoot = thread.nodes.root
|
||||||
threadRoot.hidden = thread.isHidden = false
|
threadRoot.hidden = thread.isHidden = false
|
||||||
Index.updateHideLabel() if Conf['JSON Index']
|
Index.updateHideLabel() if Conf['JSON Index']
|
||||||
|
|||||||
@ -163,10 +163,10 @@ Build =
|
|||||||
href: "/#{boardID}/thread/#{threadID}"
|
href: "/#{boardID}/thread/#{threadID}"
|
||||||
|
|
||||||
thread: (thread, data) ->
|
thread: (thread, data) ->
|
||||||
if (root = thread.OP.nodes.root.parentNode)
|
if (root = thread.nodes.root)
|
||||||
$.rmAll root
|
$.rmAll root
|
||||||
else
|
else
|
||||||
root = $.el 'div',
|
thread.nodes.root = root = $.el 'div',
|
||||||
className: 'thread'
|
className: 'thread'
|
||||||
id: "t#{data.no}"
|
id: "t#{data.no}"
|
||||||
$.add root, Build.hat.cloneNode(false) if Build.hat
|
$.add root, Build.hat.cloneNode(false) if Build.hat
|
||||||
|
|||||||
@ -10,7 +10,7 @@ ExpandThread =
|
|||||||
cb: -> ExpandThread.setButton @
|
cb: -> ExpandThread.setButton @
|
||||||
|
|
||||||
setButton: (thread) ->
|
setButton: (thread) ->
|
||||||
return unless a = $.x 'following-sibling::*[contains(@class,"summary")][1]', thread.OP.nodes.root
|
return unless thread.nodes.root and (a = $ '.summary', thread.nodes.root)
|
||||||
a.textContent = Build.summaryText '+', a.textContent.match(/\d+/g)...
|
a.textContent = Build.summaryText '+', a.textContent.match(/\d+/g)...
|
||||||
a.style.cursor = 'pointer'
|
a.style.cursor = 'pointer'
|
||||||
$.on a, 'click', ExpandThread.cbToggle
|
$.on a, 'click', ExpandThread.cbToggle
|
||||||
@ -34,7 +34,7 @@ ExpandThread =
|
|||||||
ExpandThread.toggle Get.threadFromNode @
|
ExpandThread.toggle Get.threadFromNode @
|
||||||
|
|
||||||
toggle: (thread) ->
|
toggle: (thread) ->
|
||||||
threadRoot = thread.OP.nodes.root.parentNode
|
threadRoot = thread.nodes.root
|
||||||
return unless a = $ '.summary', threadRoot
|
return unless a = $ '.summary', threadRoot
|
||||||
if thread.ID of ExpandThread.statuses
|
if thread.ID of ExpandThread.statuses
|
||||||
ExpandThread.contract thread, a, threadRoot
|
ExpandThread.contract thread, a, threadRoot
|
||||||
|
|||||||
@ -67,7 +67,7 @@ ThreadUpdater =
|
|||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
ThreadUpdater.thread = @
|
ThreadUpdater.thread = @
|
||||||
ThreadUpdater.root = @OP.nodes.root.parentNode
|
ThreadUpdater.root = @nodes.root
|
||||||
ThreadUpdater.outdateCount = 0
|
ThreadUpdater.outdateCount = 0
|
||||||
|
|
||||||
# We must keep track of our own list of live posts/files
|
# We must keep track of our own list of live posts/files
|
||||||
|
|||||||
@ -139,7 +139,7 @@ QuoteThreading =
|
|||||||
$.rmClass post.nodes.root, 'threadOP'
|
$.rmClass post.nodes.root, 'threadOP'
|
||||||
$.rm post.nodes.threadContainer
|
$.rm post.nodes.threadContainer
|
||||||
delete post.nodes.threadContainer
|
delete post.nodes.threadContainer
|
||||||
$.add thread.OP.nodes.root.parentNode, nodes
|
$.add thread.nodes.root, nodes
|
||||||
|
|
||||||
Unread.position = Unread.order.first
|
Unread.position = Unread.order.first
|
||||||
Unread.updatePosition()
|
Unread.updatePosition()
|
||||||
|
|||||||
@ -17,6 +17,9 @@ class Thread
|
|||||||
@OP = null
|
@OP = null
|
||||||
@catalogView = null
|
@catalogView = null
|
||||||
|
|
||||||
|
@nodes =
|
||||||
|
root: null
|
||||||
|
|
||||||
@board.threads.push @ID, @
|
@board.threads.push @ID, @
|
||||||
g.threads.push @fullID, @
|
g.threads.push @fullID, @
|
||||||
|
|
||||||
|
|||||||
@ -274,6 +274,7 @@ Main =
|
|||||||
|
|
||||||
for threadRoot in $$ '.board > .thread', board
|
for threadRoot in $$ '.board > .thread', board
|
||||||
thread = new Thread +threadRoot.id[1..], g.BOARD
|
thread = new Thread +threadRoot.id[1..], g.BOARD
|
||||||
|
thread.nodes.root = threadRoot
|
||||||
threads.push thread
|
threads.push thread
|
||||||
for postRoot in $$('.thread > .postContainer', threadRoot) when $('.postMessage', postRoot)
|
for postRoot in $$('.thread > .postContainer', threadRoot) when $('.postMessage', postRoot)
|
||||||
try
|
try
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user