diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ca2ce1a1831..cf1d9780d99 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1921,7 +1921,13 @@ // Animation var _this = this; - this.$container.animate({ + var $scrollContainer = this.$container; + if ($scrollContainer[0] === window) { + // need to use "body" to animate scrolling + // when the scroll container is the window + $scrollContainer = $('body'); + } + $scrollContainer.animate({ // Scrolling to the top of the new element scrollTop: currentOffset + $fileRow.offset().top - $fileRow.height() * 2 - additionalOffset }, { |