Do not hide posts when inlining backlinks.

This commit is contained in:
Nicolas Stepien 2011-11-24 00:47:04 +01:00
parent a235657f73
commit 4bad123c32
2 changed files with 3 additions and 26 deletions

View File

@ -2343,7 +2343,7 @@
quoteInline.rm(this, id);
} else {
if ($.x("ancestor::*[@id='" + id + "']", this)) return;
quoteInline.add(this, id);
$.rm = $.x("following::*[@id='i" + id + "']", this);
}
return this.classList.toggle('inlined');
},
@ -2354,7 +2354,6 @@
inline = quoteInline.table(id, el.innerHTML);
if (q.className === 'backlink') {
$.after(q.parentNode, inline);
$.x('ancestor::table', el).hidden = true;
return;
}
return $.after(root, inline);
@ -2372,19 +2371,6 @@
}));
}
},
rm: function(q, id) {
var inlined, table, _i, _len, _ref;
table = $.x("following::*[@id='i" + id + "']", q);
_ref = $$('.backlink.inlined:not(.filtered)', table);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
inlined = _ref[_i];
$.x('ancestor::table', $.id(inlined.hash.slice(1))).hidden = false;
}
if (/\bbacklink\b/.test(q.className) && !/\bfiltered\b/.test(q.className)) {
$.x('ancestor::table', $.id(id)).hidden = false;
}
return $.rm(table);
},
parse: function(req, pathname, id, threadID, inline) {
var body, href, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2;
if (!inline.parentNode) return;

View File

@ -1807,7 +1807,8 @@ quoteInline =
quoteInline.rm @, id
else
return if $.x("ancestor::*[@id='#{id}']", @)
quoteInline.add @, id
# remove the corresponding table or loading td
$.rm = $.x "following::*[@id='i#{id}']", @
@classList.toggle 'inlined'
add: (q, id) ->
@ -1816,7 +1817,6 @@ quoteInline =
inline = quoteInline.table id, el.innerHTML
if q.className is 'backlink'
$.after q.parentNode, inline
$.x('ancestor::table', el).hidden = true
return
$.after root, inline
else
@ -1829,15 +1829,6 @@ quoteInline =
threadID = pathname.split('/').pop()
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)
rm: (q, id) ->
#select the corresponding table or loading td
table = $.x "following::*[@id='i#{id}']", q
for inlined in $$ '.backlink.inlined:not(.filtered)', table
$.x('ancestor::table', $.id inlined.hash[1..]).hidden = false
if /\bbacklink\b/.test(q.className) and not /\bfiltered\b/.test q.className
$.x('ancestor::table', $.id id).hidden = false
$.rm table
parse: (req, pathname, id, threadID, inline) ->
return unless inline.parentNode