[Pkg-owncloud-commits] [owncloud] 08/61: Fix preview animation on uploading

David Prévot taffit at moszumanska.debian.org
Thu Jul 31 03:51:41 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 d6e61745c88c63590fa849ce77bc42ab66c71814
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Jul 17 12:42:09 2014 +0200

    Fix preview animation on uploading
    
    When adding/uploading files, the preview is now animated.
    When loading a list of files directly the preview is displayed directly.
---
 apps/files/js/filelist.js               | 6 ++++--
 apps/files_sharing/js/sharedfilelist.js | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 4ff7d0c..4fa8ca6 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -712,6 +712,7 @@
 		 * @param options map of attributes:
 		 * - "updateSummary": true to update the summary after adding (default), false otherwise
 		 * - "silent": true to prevent firing events like "fileActionsReady"
+		 * - "animate": true to animate preview loading (defaults to true here)
 		 * @return new tr element (not appended to the table)
 		 */
 		add: function(fileData, options) {
@@ -719,7 +720,7 @@
 			var $tr;
 			var $rows;
 			var $insertionPoint;
-			options = options || {};
+			options = _.extend({animate: true}, options || {});
 
 			// there are three situations to cover:
 			// 1) insertion point is visible on the current page
@@ -777,6 +778,7 @@
 		 * @param options map of attributes:
 		 * - "index" optional index at which to insert the element
 		 * - "updateSummary" true to update the summary after adding (default), false otherwise
+		 * - "animate" true to animate the preview rendering
 		 * @return new tr element (not appended to the table)
 		 */
 		_renderRow: function(fileData, options) {
@@ -818,7 +820,7 @@
 
 			if (fileData.isPreviewAvailable) {
 				// lazy load / newly inserted td ?
-				if (!fileData.icon) {
+				if (options.animate) {
 					this.lazyLoadPreview({
 						path: path + '/' + fileData.name,
 						mime: mime,
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index d5c65a6..c060691 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -162,7 +162,6 @@
 					else {
 						file.type = 'file';
 						if (share.isPreviewAvailable) {
-							file.icon = true;
 							file.isPreviewAvailable = true;
 						}
 					}

-- 
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