Work around Edge issues with HTMLCollections.

This commit is contained in:
ccd0 2015-08-02 01:37:39 -07:00
parent c52e8e9ef8
commit 900daa3e56
2 changed files with 18 additions and 2 deletions

View File

@ -19,7 +19,15 @@ class Clone extends Post
quote: $ '.postNum > a:nth-of-type(2)', info
comment: $ '.postMessage', post
quotelinks: []
backlinks: info.getElementsByClassName 'backlink'
# XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node.
if $.engine is 'edge'
Object.defineProperty @nodes, 'backlinks',
configurable: true
enumerable: true
get: -> info.getElementsByClassName 'backlink'
else
@nodes.backlinks = info.getElementsByClassName 'backlink'
# Remove inlined posts inside of this post.
for inline in $$ '.inline', post

View File

@ -40,7 +40,15 @@ class Post
comment: $ '.postMessage', post
links: []
quotelinks: []
backlinks: info.getElementsByClassName 'backlink'
# XXX Edge invalidates HTMLCollections when an ancestor node is inserted into another node.
if $.engine is 'edge'
Object.defineProperty @nodes, 'backlinks',
configurable: true
enumerable: true
get: -> info.getElementsByClassName 'backlink'
else
@nodes.backlinks = info.getElementsByClassName 'backlink'
unless @isReply = $.hasClass post, 'reply'
@thread.OP = @