]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix preview animation on uploading
authorVincent Petry <pvince81@owncloud.com>
Thu, 17 Jul 2014 10:42:09 +0000 (12:42 +0200)
committerVincent Petry <pvince81@owncloud.com>
Thu, 17 Jul 2014 10:42:09 +0000 (12:42 +0200)
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
apps/files_sharing/js/sharedfilelist.js

index 61e73b7bebc9f94e73514f42622a62caf569c7f3..9740cc87ec531ec6bdf35e892dbd2ae9cdd16c02 100644 (file)
                 * @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) {
                        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
                 * @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) {
 
                        if (fileData.isPreviewAvailable) {
                                // lazy load / newly inserted td ?
-                               if (!fileData.icon) {
+                               if (options.animate) {
                                        this.lazyLoadPreview({
                                                path: path + '/' + fileData.name,
                                                mime: mime,
index d5c65a6c6813b98b9c1d7efdc7a854c527dffd93..c060691b8b5814129ec3129d8e738de625e21a0c 100644 (file)
                                        else {
                                                file.type = 'file';
                                                if (share.isPreviewAvailable) {
-                                                       file.icon = true;
                                                        file.isPreviewAvailable = true;
                                                }
                                        }