fix backlink inlining

This commit is contained in:
James Campos 2011-05-27 05:18:33 -07:00
parent 1b9fdd5479
commit fc59170d47
2 changed files with 4 additions and 5 deletions

View File

@ -1778,8 +1778,8 @@
},
toggle: function(e) {
var el, id, inline, pathname, root, table, threadID;
id = this.hash.slice(1);
e.preventDefault();
id = this.hash.slice(1);
root = $.x('ancestor::td[1]', this);
if (table = $("#i" + id, root)) {
$.rm(table);
@ -1792,7 +1792,7 @@
if (el = d.getElementById(id)) {
inline = quoteInline.table(id, el.innerHTML);
if (this.className === 'backlink') {
$.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline);
$.after(this.parentNode, inline);
$.hide($.x('ancestor::table[1]', el));
} else {
$.after(this.parentNode, inline);

View File

@ -1417,8 +1417,8 @@ quoteInline =
quote.removeAttribute 'onclick'
$.bind quote, 'click', quoteInline.toggle
toggle: (e) ->
id = @hash[1..]
e.preventDefault()
id = @hash[1..]
root = $.x 'ancestor::td[1]', @
if table = $ "#i#{id}", root
$.rm table
@ -1429,7 +1429,7 @@ quoteInline =
if el = d.getElementById id
inline = quoteInline.table id, el.innerHTML
if @className is 'backlink'
$.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline
$.after @parentNode, inline
$.hide $.x 'ancestor::table[1]', el
else
$.after @parentNode, inline
@ -1439,7 +1439,6 @@ quoteInline =
id: "i#{id}"
innerHTML: "Loading #{id}..."
$.after @parentNode, inline
# or ... is for index page new posts.
{pathname} = @
threadID = pathname.split('/').pop()
$.cache pathname, (-> quoteInline.parse @, pathname, id, threadID, inline)