From cc8c0efb4d60866825e42bd86ff239aafbbb958a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 17 May 2011 19:01:39 +0200 Subject: [PATCH] Rehide? --- 4chan_x.js | 9 +++++++-- script.coffee | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 305876b8e..a1a8841f6 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1738,7 +1738,11 @@ } root = $.x('ancestor::td[1]', this); if (td = $("#i" + id, root)) { - return $.rm(td); + $.rm($.x('ancestor::table[1]', td)); + if (this.className === 'backlink') { + $.show($.x('ancestor::table[1]', d.getElementById(id))); + } + return; } inline = $.el('table', { className: 'inline', @@ -1761,7 +1765,8 @@ } } if (this.className === 'backlink') { - return $.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline); + $.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline); + return $.hide($.x('ancestor::table[1]', el)); } else { return $.after(this.parentNode, inline); } diff --git a/script.coffee b/script.coffee index 226ed6027..3c2f2330f 100644 --- a/script.coffee +++ b/script.coffee @@ -1389,7 +1389,10 @@ quoteInline = return unless id = @hash[1..] root = $.x 'ancestor::td[1]', this if td = $ "#i#{id}", root - return $.rm td + $.rm $.x 'ancestor::table[1]', td + if @className is 'backlink' + $.show $.x 'ancestor::table[1]', d.getElementById id + return inline = $.el 'table', className: 'inline' innerHTML: "" @@ -1409,6 +1412,7 @@ quoteInline = g.requests[threadID] = $.get @href, (-> quoteInline.parse this, id, threadID, inline) if @className is 'backlink' $.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline + $.hide $.x 'ancestor::table[1]', el else $.after @parentNode, inline parse: (req, id, threadID, inline) ->