mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 06:11:44 +08:00
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:
commit
a3276c042d
|
@ -243,8 +243,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
},
|
},
|
||||||
|
|
||||||
_scrollList: function($article, direction) {
|
_scrollList: function($article, direction) {
|
||||||
var $body = $('body'),
|
var $document = $(document),
|
||||||
distToElement = $article.position().top + $article.height() - $(window).height() - $body.scrollTop();
|
distToElement = $article.position().top + $article.height() - $(window).height() - $document.scrollTop();
|
||||||
|
|
||||||
// cut some bottom slack
|
// cut some bottom slack
|
||||||
distToElement += 40;
|
distToElement += 40;
|
||||||
|
@ -254,7 +254,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('html, body').scrollTop($body.scrollTop() + distToElement);
|
$('html, body').scrollTop($document.scrollTop() + distToElement);
|
||||||
},
|
},
|
||||||
|
|
||||||
_findArticles: function() {
|
_findArticles: function() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user