summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2014-09-24 12:17:30 -0700
committerczaks <marcin@6irc.net>2014-10-07 03:27:33 +0200
commit67d3449998cda1a981a841fce989f59936aaa8d1 (patch)
tree91aec340765873a1d30f4fa9e18754b736dab896
parent274ac0965a6085c009fccbde1e427746d8ff4501 (diff)
fix cross-thread inlining
-rw-r--r--js/inline.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/inline.js b/js/inline.js
index 863aefbb..6334e60e 100644
--- a/js/inline.js
+++ b/js/inline.js
@@ -8,8 +8,8 @@
if ($clone.length)
return $clone.remove()
- var OP = $('input[name="thread"]').val()
- var selector = postNum === OP
+ var postOP = this.pathname.match(/(\d+).html/)[1]
+ var selector = postNum === postOP
? '.op .body'
: '#reply_' + postNum + ' .body'
@@ -17,9 +17,12 @@
postNum: postNum,
node: this
}
- var $target = $(selector)
- if ($target.length)
+
+ var OP = $('input[name="thread"]').val()
+ if (OP === postOP) {
+ var $target = $(selector)
add(link, $target)
+ }
else
$.get(this.pathname, function(data) {
var $target = $(data).find(selector)