Incorporate Mayhem's Get.postFromRoot simplifications from 59f2ca6a5128bfadb8c3472c9e081d2b46d7e970.
This commit is contained in:
parent
6b167d42b9
commit
3750c5bdf5
@ -13,11 +13,8 @@ Get =
|
|||||||
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
|
Get.threadFromRoot $.x 'ancestor::div[@class="thread"]', node
|
||||||
postFromRoot: (root) ->
|
postFromRoot: (root) ->
|
||||||
return null unless root?
|
return null unless root?
|
||||||
link = $ '.postNum > a[href*="#"]', root
|
post = g.posts[root.dataset.fullID]
|
||||||
boardID = link.pathname.split(/\/+/)[1]
|
index = root.dataset.clone
|
||||||
postID = link.hash[2..]
|
|
||||||
index = root.dataset.clone
|
|
||||||
post = g.posts["#{boardID}.#{postID}"]
|
|
||||||
if index then post.clones[index] else post
|
if index then post.clones[index] else post
|
||||||
postFromNode: (root) ->
|
postFromNode: (root) ->
|
||||||
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root
|
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root
|
||||||
|
|||||||
@ -30,6 +30,7 @@ class Post
|
|||||||
@fullID = "#{@board}.#{@ID}"
|
@fullID = "#{@board}.#{@ID}"
|
||||||
@context = @
|
@context = @
|
||||||
|
|
||||||
|
root.dataset.fullID = @fullID
|
||||||
post = $ '.post', root
|
post = $ '.post', root
|
||||||
info = $ '.postInfo', post
|
info = $ '.postInfo', post
|
||||||
@nodes =
|
@nodes =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user