1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-01 10:37:18 +01:00
This commit is contained in:
James Campos 2014-10-03 13:32:41 -07:00
parent 09684c5450
commit 241eb0c6c7

View File

@ -5,16 +5,16 @@
e.preventDefault() e.preventDefault()
var $root = $(this).closest('.post') var $root = $(this).closest('.post')
var postNum = this.textContent.slice(2) var targetNum = this.textContent.slice(2)
var $clone = $root.find('#inline_' + postNum) var $clone = $root.find('#inline_' + targetNum)
if ($clone.length) if ($clone.length)
return $clone.remove() return $clone.remove()
var postOP = this.pathname.match(/(\d+).html/)[1] var targetOP = this.pathname.match(/(\d+).html/)[1]
var selector = postNum === postOP var selector = targetNum === targetOP
? '.op .body' ? '.op .body'
: '#reply_' + postNum : '#reply_' + targetNum
var node = this.className var node = this.className
? $root.find('> .intro') ? $root.find('> .intro')
@ -22,11 +22,11 @@
var link = { var link = {
node: node, node: node,
postNum: postNum targetNum: targetNum
} }
var srcOP = $root.closest('[id^=thread]').attr('id').match(/\d+/)[0] var srcOP = $root.closest('[id^=thread]').attr('id').match(/\d+/)[0]
if (srcOP === postOP) { if (srcOP === targetOP) {
// XXX post hover adds fetched threads to the DOM // XXX post hover adds fetched threads to the DOM
selector = '#thread_' + srcOP + ' ' + selector selector = '#thread_' + srcOP + ' ' + selector
// XXX bypass the `(OP)` text // XXX bypass the `(OP)` text
@ -55,7 +55,7 @@
var $clone = $target.clone(true) var $clone = $target.clone(true)
$clone.attr({ $clone.attr({
"class": 'inline post', "class": 'inline post',
id: 'inline_' + link.postNum, id: 'inline_' + link.targetNum,
style: null// XXX remove post hover styling style: null// XXX remove post hover styling
}) })
$clone.insertAfter(link.node) $clone.insertAfter(link.node)