diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-10-15 10:14:20 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-10-15 10:14:20 +0200 |
commit | 704ffaa6a37730f02a3359e8e8f0a0070f0e0d31 (patch) | |
tree | 7a5a730ccba8f0a1fcd1a1ffd8b1dc2b36a78208 /apps/files | |
parent | 3b3affa1ef26cb55706b851fc1a13206845754e4 (diff) | |
download | nextcloud-server-704ffaa6a37730f02a3359e8e8f0a0070f0e0d31.tar.gz nextcloud-server-704ffaa6a37730f02a3359e8e8f0a0070f0e0d31.zip |
Use body element when animating scroll in public page
In the public page the scroll container is the window instead of a div.
The $(window) object doesn't support animating the scroll property, so
the $('body') element is used instead.
Diffstat (limited to 'apps/files')
-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 86cba29e76c..c70c866c634 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1919,7 +1919,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 }, { |