From 17d72de36dd65e93c78d7a39ddeb506b06bec698 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 3 Jun 2011 02:41:40 +0200 Subject: [PATCH] Fix hidden backlinks. Close #141 --- 4chan_x.user.js | 8 ++++++-- script.coffee | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 02f5a3ff7..6d22e0894 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1792,14 +1792,18 @@ return _results; }, toggle: function(e) { - var el, id, inline, pathname, root, table, threadID; + var el, id, inline, inlined, pathname, root, table, threadID, _i, _len, _ref; e.preventDefault(); id = this.hash.slice(1); if (table = $("#i" + id, $.x('ancestor::td[1]', this))) { $.rm(table); $.removeClass(this, 'inlined'); if (this.className === 'backlink') { - $.show($.x('ancestor::table[1]', d.getElementById(id))); + _ref = $$('input', table); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + inlined = _ref[_i]; + $.show($.x('ancestor::table[1]', d.getElementById(inlined.name))); + } } return; } diff --git a/script.coffee b/script.coffee index 8d66cbdff..15b943031 100644 --- a/script.coffee +++ b/script.coffee @@ -1427,7 +1427,8 @@ quoteInline = $.rm table $.removeClass @, 'inlined' if @className is 'backlink' - $.show $.x 'ancestor::table[1]', d.getElementById id + for inlined in $$ 'input', table + $.show $.x 'ancestor::table[1]', d.getElementById inlined.name return root = if @parentNode.nodeName is 'FONT' then @parentNode else @nextSibling if el = d.getElementById id