diff --git a/4chan_x.js b/4chan_x.js index 48d4f65bd..3ee162adb 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1731,14 +1731,14 @@ return _results; }, toggle: function(e) { - var el, id, inline, req, root, td, threadID; + var el, id, inline, req, root, table, threadID; e.preventDefault(); if (!(id = this.hash.slice(1))) { return; } root = $.x('ancestor::td[1]', this); - if (td = $("#i" + id, root)) { - $.rm($.x('ancestor::table[1]', td)); + if (table = $("#i" + id, root)) { + $.rm(table); if (this.className === 'backlink') { $.show($.x('ancestor::table[1]', d.getElementById(id))); } @@ -1755,6 +1755,7 @@ } else { inline = $.el('td', { className: 'reply inline', + id: "i" + id, innerHTML: "Loading " + id + "..." }); $.after(this.parentNode, inline); @@ -1799,7 +1800,8 @@ table: function(id, html) { return $.el('table', { className: 'inline', - innerHTML: "" + html + "" + id: "i" + id, + innerHTML: "" + html + "" }); } }; @@ -1919,7 +1921,7 @@ }, cb: { node: function(root) { - if (root.className === 'inline') { + if (root.className) { return; } unread.replies.push(root); diff --git a/script.coffee b/script.coffee index 418d24f7f..18a9ab228 100644 --- a/script.coffee +++ b/script.coffee @@ -1388,8 +1388,8 @@ quoteInline = e.preventDefault() return unless id = @hash[1..] root = $.x 'ancestor::td[1]', this - if td = $ "#i#{id}", root - $.rm $.x 'ancestor::table[1]', td + if table = $ "#i#{id}", root + $.rm table if @className is 'backlink' $.show $.x 'ancestor::table[1]', d.getElementById id return @@ -1403,6 +1403,7 @@ quoteInline = else inline = $.el 'td', className: 'reply inline' + id: "i#{id}" innerHTML: "Loading #{id}..." $.after @parentNode, inline # or ... is for index page new posts. @@ -1434,7 +1435,8 @@ quoteInline = table: (id, html) -> $.el 'table', className: 'inline' - innerHTML: "#{html}" + id: "i#{id}" + innerHTML: "#{html}" quotePreview = init: -> @@ -1515,7 +1517,7 @@ unread = cb: node: (root) -> - return if root.className is 'inline' + return if root.className unread.replies.push root unread.updateTitle() Favicon.update()