Fix quote inlining in some cases.

This commit is contained in:
Nicolas Stepien 2011-06-01 21:13:04 +02:00
parent 3dbd5e9815
commit 89d5abd696
2 changed files with 7 additions and 5 deletions

View File

@ -1783,10 +1783,11 @@
return _results; return _results;
}, },
toggle: function(e) { toggle: function(e) {
var el, id, inline, pathname, root, table, threadID; var el, id, inline, link, pathname, root, table, threadID;
e.preventDefault(); e.preventDefault();
id = this.hash.slice(1); id = this.hash.slice(1);
root = $.x('ancestor::td[1]', this); root = $.x('ancestor::td[1]', this);
link = this.parentNode.nodeName === 'FONT' ? this.parentNode : this.nextSibling;
if (table = $("#i" + id, root)) { if (table = $("#i" + id, root)) {
$.rm(table); $.rm(table);
$.removeClass(this, 'inlined'); $.removeClass(this, 'inlined');
@ -1801,7 +1802,7 @@
$.after(this.parentNode, inline); $.after(this.parentNode, inline);
$.hide($.x('ancestor::table[1]', el)); $.hide($.x('ancestor::table[1]', el));
} else { } else {
$.after(this.parentNode, inline); $.after(link, inline);
} }
} else { } else {
inline = $.el('td', { inline = $.el('td', {
@ -1809,7 +1810,7 @@
id: "i" + id, id: "i" + id,
innerHTML: "Loading " + id + "..." innerHTML: "Loading " + id + "..."
}); });
$.after(this.parentNode, inline); $.after(link, inline);
pathname = this.pathname; pathname = this.pathname;
threadID = pathname.split('/').pop(); threadID = pathname.split('/').pop();
$.cache(pathname, (function() { $.cache(pathname, (function() {

View File

@ -1419,6 +1419,7 @@ quoteInline =
e.preventDefault() e.preventDefault()
id = @hash[1..] id = @hash[1..]
root = $.x 'ancestor::td[1]', @ root = $.x 'ancestor::td[1]', @
link = if @parentNode.nodeName is 'FONT' then @parentNode else @nextSibling
if table = $ "#i#{id}", root if table = $ "#i#{id}", root
$.rm table $.rm table
$.removeClass @, 'inlined' $.removeClass @, 'inlined'
@ -1431,13 +1432,13 @@ quoteInline =
$.after @parentNode, inline $.after @parentNode, inline
$.hide $.x 'ancestor::table[1]', el $.hide $.x 'ancestor::table[1]', el
else else
$.after @parentNode, inline $.after link, inline
else else
inline = $.el 'td', inline = $.el 'td',
className: 'reply inline' className: 'reply inline'
id: "i#{id}" id: "i#{id}"
innerHTML: "Loading #{id}..." innerHTML: "Loading #{id}..."
$.after @parentNode, inline $.after link, inline
{pathname} = @ {pathname} = @
threadID = pathname.split('/').pop() threadID = pathname.split('/').pop()
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline) $.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)