Do not hide posts when inlining backlinks.
This commit is contained in:
parent
a235657f73
commit
4bad123c32
@ -2343,7 +2343,7 @@
|
|||||||
quoteInline.rm(this, id);
|
quoteInline.rm(this, id);
|
||||||
} else {
|
} else {
|
||||||
if ($.x("ancestor::*[@id='" + id + "']", this)) return;
|
if ($.x("ancestor::*[@id='" + id + "']", this)) return;
|
||||||
quoteInline.add(this, id);
|
$.rm = $.x("following::*[@id='i" + id + "']", this);
|
||||||
}
|
}
|
||||||
return this.classList.toggle('inlined');
|
return this.classList.toggle('inlined');
|
||||||
},
|
},
|
||||||
@ -2354,7 +2354,6 @@
|
|||||||
inline = quoteInline.table(id, el.innerHTML);
|
inline = quoteInline.table(id, el.innerHTML);
|
||||||
if (q.className === 'backlink') {
|
if (q.className === 'backlink') {
|
||||||
$.after(q.parentNode, inline);
|
$.after(q.parentNode, inline);
|
||||||
$.x('ancestor::table', el).hidden = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return $.after(root, inline);
|
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) {
|
parse: function(req, pathname, id, threadID, inline) {
|
||||||
var body, href, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2;
|
var body, href, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2;
|
||||||
if (!inline.parentNode) return;
|
if (!inline.parentNode) return;
|
||||||
|
|||||||
@ -1807,7 +1807,8 @@ quoteInline =
|
|||||||
quoteInline.rm @, id
|
quoteInline.rm @, id
|
||||||
else
|
else
|
||||||
return if $.x("ancestor::*[@id='#{id}']", @)
|
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'
|
@classList.toggle 'inlined'
|
||||||
|
|
||||||
add: (q, id) ->
|
add: (q, id) ->
|
||||||
@ -1816,7 +1817,6 @@ quoteInline =
|
|||||||
inline = quoteInline.table id, el.innerHTML
|
inline = quoteInline.table id, el.innerHTML
|
||||||
if q.className is 'backlink'
|
if q.className is 'backlink'
|
||||||
$.after q.parentNode, inline
|
$.after q.parentNode, inline
|
||||||
$.x('ancestor::table', el).hidden = true
|
|
||||||
return
|
return
|
||||||
$.after root, inline
|
$.after root, inline
|
||||||
else
|
else
|
||||||
@ -1829,15 +1829,6 @@ quoteInline =
|
|||||||
threadID = pathname.split('/').pop()
|
threadID = pathname.split('/').pop()
|
||||||
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)
|
$.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) ->
|
parse: (req, pathname, id, threadID, inline) ->
|
||||||
return unless inline.parentNode
|
return unless inline.parentNode
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user