I always forget that Firefox is shit and doesn't let you select nodes in a logical order.
This commit is contained in:
Nicolas Stepien 2012-05-09 10:00:36 +02:00
parent 2af993300c
commit 8e651ff102
2 changed files with 3 additions and 6 deletions

View File

@ -1287,7 +1287,7 @@
post.removeAttribute('tabindex');
rect = post.getBoundingClientRect();
if (rect.bottom >= 0 && rect.top <= d.documentElement.clientHeight) {
next = delta === +1 ? $.x('parent::div/following-sibling::div/div[contains(@class,"reply")]', post) : $.x('parent::div/preceding-sibling::div/div[contains(@class,"reply")]', post);
next = $.x('child::div[contains(@class,"post reply")]', delta === +1 ? post.parentNode.nextElementSibling : post.parentNode.previousElementSibling);
if (!next) {
this.focus(post);
return;

View File

@ -968,11 +968,8 @@ Keybinds =
post.removeAttribute 'tabindex'
rect = post.getBoundingClientRect()
if rect.bottom >= 0 and rect.top <= d.documentElement.clientHeight # We're at least partially visible
next =
if delta is +1
$.x 'parent::div/following-sibling::div/div[contains(@class,"reply")]', post
else
$.x 'parent::div/preceding-sibling::div/div[contains(@class,"reply")]', post
next = $.x 'child::div[contains(@class,"post reply")]',
if delta is +1 then post.parentNode.nextElementSibling else post.parentNode.previousElementSibling
unless next
@focus post
return