Fix indentation and next.focus() -> td.focus().

This commit is contained in:
Nicolas Stepien 2012-03-06 19:53:43 +01:00
parent a1ed6c59b0
commit afcc55b2c8
2 changed files with 26 additions and 26 deletions

View File

@ -1167,24 +1167,24 @@
rect = td.getBoundingClientRect();
if (rect.bottom >= 0 && rect.top <= d.body.clientHeight) {
next = delta === +1 ? $.x('following::td[@class="reply"]', td) : $.x('preceding::td[@class="reply"]', td);
}
if (!next) {
td.className = 'replyhl';
td.tabIndex = 0;
if (!next) {
td.className = 'replyhl';
td.tabIndex = 0;
td.focus();
return;
}
if (!(g.REPLY || $.x('ancestor::div[@class="thread"]', next) === thread)) {
return;
}
rect = next.getBoundingClientRect();
if (rect.top < 0 || rect.bottom > d.body.clientHeight) {
next.scrollIntoView(delta === -1);
}
next.className = 'replyhl';
next.tabIndex = 0;
next.focus();
return;
}
if (!(g.REPLY || $.x('ancestor::div[@class="thread"]', next) === thread)) {
return;
}
rect = next.getBoundingClientRect();
if (rect.top < 0 || rect.bottom > d.body.clientHeight) {
next.scrollIntoView(delta === -1);
}
next.className = 'replyhl';
next.tabIndex = 0;
next.focus();
return;
}
replies = $$('.reply', thread);
if (delta === -1) replies.reverse();

View File

@ -954,19 +954,19 @@ Keybinds =
$.x 'following::td[@class="reply"]', td
else
$.x 'preceding::td[@class="reply"]', td
unless next
td.className = 'replyhl'
td.tabIndex = 0
unless next
td.className = 'replyhl'
td.tabIndex = 0
td.focus()
return
return unless g.REPLY or $.x('ancestor::div[@class="thread"]', next) is thread
rect = next.getBoundingClientRect()
if rect.top < 0 or rect.bottom > d.body.clientHeight
next.scrollIntoView delta is -1
next.className = 'replyhl'
next.tabIndex = 0
next.focus()
return
return unless g.REPLY or $.x('ancestor::div[@class="thread"]', next) is thread
rect = next.getBoundingClientRect()
if rect.top < 0 or rect.bottom > d.body.clientHeight
next.scrollIntoView delta is -1
next.className = 'replyhl'
next.tabIndex = 0
next.focus()
return
replies = $$ '.reply', thread
replies.reverse() if delta is -1