[Pkg-owncloud-commits] [owncloud] 22/34: Use body element when animating scroll in public page
David Prévot
taffit at moszumanska.debian.org
Fri Oct 17 01:32:17 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 149b55f8aeac76c2efdab1373797ef0b7a7de81a
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Wed Oct 15 10:14:20 2014 +0200
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.
Backport of 704ffaa6a37730f02a3359e8e8f0a0070f0e0d31 from master
---
apps/files/js/filelist.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 34d4885..d08e77f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1897,7 +1897,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
}, {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list