summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-17 12:42:09 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-17 12:42:09 +0200
commit7a1048956fc5374ff69de07e6309add619118174 (patch)
tree27de6016c748a23007e94b101e50083a9254a9b8 /apps
parentd58c8d72cf8c0f6784bdec1f054c24a78ff131b6 (diff)
downloadnextcloud-server-7a1048956fc5374ff69de07e6309add619118174.tar.gz
nextcloud-server-7a1048956fc5374ff69de07e6309add619118174.zip
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.
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js6
-rw-r--r--apps/files_sharing/js/sharedfilelist.js1
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 61e73b7bebc..9740cc87ec5 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -707,6 +707,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) {
@@ -714,7 +715,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
@@ -772,6 +773,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) {
@@ -813,7 +815,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 d5c65a6c681..c060691b8b5 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;
}
}