diff --git a/4chan_x.user.js b/4chan_x.user.js index 112fc86a9..8c2a8ffbb 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1292,7 +1292,7 @@ this.focus(post); return; } - if (!(g.REPLY || $.x('ancestor::div[@class="thread"]', next) === thread)) { + if (!(g.REPLY || $.x('ancestor::div[parent::div[@class="board"]]', next) === thread)) { return; } rect = next.getBoundingClientRect(); @@ -1543,7 +1543,7 @@ } QR.open(); if (!g.REPLY) { - $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', this).id.slice(1); + $('select', QR.el).value = $.x('ancestor::div[parent::div[@class="board"]]', this).id.slice(1); } id = this.previousSibling.hash.slice(2); text = ">>" + id + "\n"; @@ -4139,7 +4139,7 @@ el: el, "class": el.className, id: el.id.slice(1), - threadId: g.THREAD_ID || $.x('ancestor::div[@class="thread"]', node).id.slice(1), + threadId: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.slice(1), isInlined: /\binline\b/.test(rootClass), isCrosspost: /\bcrosspost\b/.test(rootClass), quotes: el.getElementsByClassName('quotelink'), diff --git a/script.coffee b/script.coffee index 0331237f8..94a944dfe 100644 --- a/script.coffee +++ b/script.coffee @@ -972,7 +972,7 @@ Keybinds = unless next @focus post return - return unless g.REPLY or $.x('ancestor::div[@class="thread"]', next) is thread + return unless g.REPLY or $.x('ancestor::div[parent::div[@class="board"]]', next) is thread rect = next.getBoundingClientRect() if rect.top < 0 or rect.bottom > d.documentElement.clientHeight next.scrollIntoView delta is -1 @@ -1158,7 +1158,7 @@ QR = e?.preventDefault() QR.open() unless g.REPLY - $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', @).id[1..] + $('select', QR.el).value = $.x('ancestor::div[parent::div[@class="board"]]', @).id[1..] # Make sure we get the correct number, even with XXX censors id = @previousSibling.hash[2..] text = ">>#{id}\n" @@ -3179,7 +3179,7 @@ Main = el: el class: el.className id: el.id[1..] - threadId: g.THREAD_ID or $.x('ancestor::div[@class="thread"]', node).id[1..] + threadId: g.THREAD_ID or $.x('ancestor::div[parent::div[@class="board"]]', node).id[1..] isInlined: /\binline\b/.test rootClass isCrosspost: /\bcrosspost\b/.test rootClass quotes: el.getElementsByClassName 'quotelink'