diff options
| author | James Campos <james.r.campos@gmail.com> | 2014-09-24 12:17:30 -0700 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-10-07 03:27:33 +0200 |
| commit | 67d3449998cda1a981a841fce989f59936aaa8d1 (patch) | |
| tree | 91aec340765873a1d30f4fa9e18754b736dab896 /js | |
| parent | 274ac0965a6085c009fccbde1e427746d8ff4501 (diff) | |
fix cross-thread inlining
Diffstat (limited to 'js')
| -rw-r--r-- | js/inline.js | 11 |
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) |
