From 67d3449998cda1a981a841fce989f59936aaa8d1 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 24 Sep 2014 12:17:30 -0700 Subject: [PATCH] fix cross-thread inlining --- js/inline.js | 11 +++++++---- 1 file 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)