diff options
| author | James Campos <james.r.campos@gmail.com> | 2014-10-03 13:40:05 -0700 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-10-07 03:27:35 +0200 |
| commit | 2f85073d281bc9cc6d8a09c5607f9a182c81004e (patch) | |
| tree | cb83d2f62c296c62401942af7e84c0d3d1b7c899 /js | |
| parent | 3ce156a0d0a6e451b6ecb048f4b14f8a7db057b2 (diff) | |
fix front page backlink
Diffstat (limited to 'js')
| -rw-r--r-- | js/inline.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/js/inline.js b/js/inline.js index fb50684b..2b5200fc 100644 --- a/js/inline.js +++ b/js/inline.js @@ -11,21 +11,26 @@ if ($clone.length) return $clone.remove() - var targetOP = this.pathname.match(/(\d+).html/)[1] - var selector = targetNum === targetOP - ? '.op .body' - : '#reply_' + targetNum + var srcOP = $root.closest('[id^=thread]').attr('id').match(/\d+/)[0] - var node = this.className - ? $root.find('> .intro') - : $(this) + var node, targetOP + if (this.className) {// backlink + node = $root.find('> .intro') + targetOP = srcOP + } else { + node = $(this) + targetOP = this.pathname.match(/(\d+).html/)[1] + } var link = { node: node, targetNum: targetNum } - var srcOP = $root.closest('[id^=thread]').attr('id').match(/\d+/)[0] + var selector = targetNum === targetOP + ? '.op .body' + : '#reply_' + targetNum + if (srcOP === targetOP) { // XXX post hover adds fetched threads to the DOM selector = '#thread_' + srcOP + ' ' + selector |
