From 3c98319e52bb1b902c726a435a3c77c927492925 Mon Sep 17 00:00:00 2001 From: James Campos Date: Fri, 3 Oct 2014 13:28:52 -0700 Subject: [PATCH] front page fixes --- js/inline.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/inline.js b/js/inline.js index 0ea7f233..622d40b3 100644 --- a/js/inline.js +++ b/js/inline.js @@ -25,14 +25,16 @@ postNum: postNum } - var OP = $('input[name="thread"]').val() - if (OP === postOP) { + var srcOP = $root.closest('[id^=thread]').attr('id').match(/\d+/)[0] + if (srcOP === postOP) { // XXX post hover adds fetched threads to the DOM - selector = '#thread_' + OP + ' ' + selector + selector = '#thread_' + srcOP + ' ' + selector // XXX bypass the `(OP)` text link.node = link.node.next() + var $target = $(selector) - return add(link, $target) + if ($target.length) + return add(link, $target) } var url = this.pathname @@ -53,7 +55,8 @@ var $clone = $target.clone(true) $clone.attr({ "class": 'inline post', - id: 'inline_' + link.postNum + id: 'inline_' + link.postNum, + style: null// XXX remove post hover styling }) $clone.insertAfter(link.node) }