Merge pull request #167 from MayhemYDG/fix

Fix quote inlining in some cases.
This commit is contained in:
James Campos 2011-06-01 13:14:47 -07:00
commit 4977da7d16
2 changed files with 8 additions and 8 deletions

View File

@ -1786,8 +1786,7 @@
var el, id, inline, pathname, root, table, threadID;
e.preventDefault();
id = this.hash.slice(1);
root = $.x('ancestor::td[1]', this);
if (table = $("#i" + id, root)) {
if (table = $("#i" + id, $.x('ancestor::td[1]', this))) {
$.rm(table);
$.removeClass(this, 'inlined');
if (this.className === 'backlink') {
@ -1795,13 +1794,14 @@
}
return;
}
root = this.parentNode.nodeName === 'FONT' ? this.parentNode : this.nextSibling;
if (el = d.getElementById(id)) {
inline = quoteInline.table(id, el.innerHTML);
if (this.className === 'backlink') {
$.after(this.parentNode, inline);
$.hide($.x('ancestor::table[1]', el));
} else {
$.after(this.parentNode, inline);
$.after(root, inline);
}
} else {
inline = $.el('td', {
@ -1809,7 +1809,7 @@
id: "i" + id,
innerHTML: "Loading " + id + "..."
});
$.after(this.parentNode, inline);
$.after(root, inline);
pathname = this.pathname;
threadID = pathname.split('/').pop();
$.cache(pathname, (function() {

View File

@ -1418,26 +1418,26 @@ quoteInline =
toggle: (e) ->
e.preventDefault()
id = @hash[1..]
root = $.x 'ancestor::td[1]', @
if table = $ "#i#{id}", root
if table = $ "#i#{id}", $.x 'ancestor::td[1]', @
$.rm table
$.removeClass @, 'inlined'
if @className is 'backlink'
$.show $.x 'ancestor::table[1]', d.getElementById id
return
root = if @parentNode.nodeName is 'FONT' then @parentNode else @nextSibling
if el = d.getElementById id
inline = quoteInline.table id, el.innerHTML
if @className is 'backlink'
$.after @parentNode, inline
$.hide $.x 'ancestor::table[1]', el
else
$.after @parentNode, inline
$.after root, inline
else
inline = $.el 'td',
className: 'reply inline'
id: "i#{id}"
innerHTML: "Loading #{id}..."
$.after @parentNode, inline
$.after root, inline
{pathname} = @
threadID = pathname.split('/').pop()
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)