Better placement of inlined backquotes

This commit is contained in:
Nicolas Stepien 2011-05-17 16:00:00 +02:00
parent 707afeedc2
commit 8b465172c7
2 changed files with 4 additions and 15 deletions

View File

@ -1738,11 +1738,7 @@
} }
root = $.x('ancestor::td[1]', this); root = $.x('ancestor::td[1]', this);
if (td = $("#i" + id, root)) { if (td = $("#i" + id, root)) {
$.rm($.x('ancestor::table[1]', td)); return $.rm(td);
if (this.className === 'backlink') {
$.show($.x('ancestor::table[1]', d.getElementById(id)));
}
return;
} }
inline = $.el('table', { inline = $.el('table', {
className: 'inline', className: 'inline',
@ -1765,9 +1761,7 @@
} }
} }
if (this.className === 'backlink') { if (this.className === 'backlink') {
root = $('table, blockquote', root); return $.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline);
$.before(root, inline);
return $.hide($.x('ancestor::table[1]', el));
} else { } else {
return $.after(this.parentNode, inline); return $.after(this.parentNode, inline);
} }

View File

@ -1389,10 +1389,7 @@ quoteInline =
return unless id = @hash[1..] return unless id = @hash[1..]
root = $.x 'ancestor::td[1]', this root = $.x 'ancestor::td[1]', this
if td = $ "#i#{id}", root if td = $ "#i#{id}", root
$.rm $.x 'ancestor::table[1]', td return $.rm td
if @className is 'backlink'
$.show $.x 'ancestor::table[1]', d.getElementById id
return
inline = $.el 'table', inline = $.el 'table',
className: 'inline' className: 'inline'
innerHTML: "<tbody><tr><td class=reply id=i#{id}></td></tr></tbody>" innerHTML: "<tbody><tr><td class=reply id=i#{id}></td></tr></tbody>"
@ -1411,9 +1408,7 @@ quoteInline =
#FIXME need an array of callbacks #FIXME need an array of callbacks
g.requests[threadID] = $.get @href, (-> quoteInline.parse this, id, threadID, inline) g.requests[threadID] = $.get @href, (-> quoteInline.parse this, id, threadID, inline)
if @className is 'backlink' if @className is 'backlink'
root = $ 'table, blockquote', root $.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline
$.before root, inline
$.hide $.x 'ancestor::table[1]', el
else else
$.after @parentNode, inline $.after @parentNode, inline
parse: (req, id, threadID, inline) -> parse: (req, id, threadID, inline) ->