]> 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)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 24 Jul 2014 22:00:47 +0000 (00:00 +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 4ff7d0c3fa0e43e5214de642a712f2461508d067..4fa8ca65e39db5d65edc039c5fa2e23bb5a88f77 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;
                                                }
                                        }