Merge pull request #2802 from cpradio/firefox-use-k-to-scroll-up

FIX: Firefox - Topic List Keyboard shortcut Previous(K) does not scroll properly leaving selected item hidden
This commit is contained in:
Sam 2014-09-17 00:20:48 +10:00
commit a3276c042d
1 changed files with 3 additions and 3 deletions

View File

@ -243,8 +243,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
},
_scrollList: function($article, direction) {
var $body = $('body'),
distToElement = $article.position().top + $article.height() - $(window).height() - $body.scrollTop();
var $document = $(document),
distToElement = $article.position().top + $article.height() - $(window).height() - $document.scrollTop();
// cut some bottom slack
distToElement += 40;
@ -254,7 +254,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
return;
}
$('html, body').scrollTop($body.scrollTop() + distToElement);
$('html, body').scrollTop($document.scrollTop() + distToElement);
},
_findArticles: function() {