fix cross-thread inlining

This commit is contained in:
James Campos 2014-09-24 12:17:30 -07:00 committed by czaks
parent 274ac0965a
commit 67d3449998

View File

@ -8,8 +8,8 @@
if ($clone.length) if ($clone.length)
return $clone.remove() return $clone.remove()
var OP = $('input[name="thread"]').val() var postOP = this.pathname.match(/(\d+).html/)[1]
var selector = postNum === OP var selector = postNum === postOP
? '.op .body' ? '.op .body'
: '#reply_' + postNum + ' .body' : '#reply_' + postNum + ' .body'
@ -17,9 +17,12 @@
postNum: postNum, postNum: postNum,
node: this node: this
} }
var OP = $('input[name="thread"]').val()
if (OP === postOP) {
var $target = $(selector) var $target = $(selector)
if ($target.length)
add(link, $target) add(link, $target)
}
else else
$.get(this.pathname, function(data) { $.get(this.pathname, function(data) {
var $target = $(data).find(selector) var $target = $(data).find(selector)