diff --git a/4chan_x.user.js b/4chan_x.user.js index e4e37e20e..a594692eb 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1830,13 +1830,10 @@ quoteBacklink = { init: function() { return g.callbacks.push(function(root) { - var el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results; + var container, el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results; if (/inline/.test(root.className)) { return; } - $.after($('span[id^=no]', root), $.el('span', { - className: 'container' - })); id = root.id || $('td[id]', root).id; quotes = {}; opbl = !$.config('OP Backlinks'); @@ -1871,7 +1868,12 @@ if ($.config('Quote Inline')) { $.bind(link, 'click', quoteInline.toggle); } - _results.push($.append($('.container', el), $.tn(' '), link)); + if (!(container = $('.container', el))) { + container = $.after($('span[id^=no]', el), $.el('span', { + className: 'container' + })); + } + _results.push($.append(container, $.tn(' '), link)); } return _results; }); diff --git a/script.coffee b/script.coffee index 86611aa52..fc9956fa0 100644 --- a/script.coffee +++ b/script.coffee @@ -1442,7 +1442,6 @@ quoteBacklink = init: -> g.callbacks.push (root) -> return if /inline/.test root.className - $.after $('span[id^=no]', root), $.el 'span', className: 'container' # op or reply id = root.id or $('td[id]', root).id quotes = {} @@ -1467,7 +1466,9 @@ quoteBacklink = $.bind link, 'mouseout', quotePreview.mouseout if $.config 'Quote Inline' $.bind link, 'click', quoteInline.toggle - $.append $('.container', el), $.tn(' '), link + unless container = $ '.container', el + container = $.after $('span[id^=no]', el), $.el 'span', className: 'container' + $.append container, $.tn(' '), link quoteInline = init: ->