]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed file actions fallback
authorVincent Petry <pvince81@owncloud.com>
Fri, 20 Jun 2014 10:58:04 +0000 (12:58 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 20 Jun 2014 10:58:04 +0000 (12:58 +0200)
Some apps are calling FileActions.display() directly but omit the new
fileList argument.

This fix makes the fileList argument correctly fall back to the default
file list (the one from the "All files" section)

apps/files/js/fileactions.js

index de02bf5e730c6d0efb8d4b65414ace6fd6c9ef3a..5bd75ac62876b1fc66261a90b049b7e5776cebee 100644 (file)
                display: function (parent, triggerEvent, fileList) {
                        if (!fileList) {
                                console.warn('FileActions.display() MUST be called with a OCA.Files.FileList instance');
+                               // using default list instead, which could be wrong
+                               fileList = OCA.Files.App.fileList;
                        }
                        this.currentFile = parent;
                        var self = this;
 
                                event.data.actionFunc(file, {
                                        $file: $tr,
-                                       fileList: fileList || OCA.Files.App.fileList,
+                                       fileList: fileList,
                                        fileActions: self,
                                        dir: $tr.attr('data-path') || fileList.getCurrentDirectory()
                                });