]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix fileList fallback in OC.Share for outside files app
authorVincent Petry <pvince81@owncloud.com>
Wed, 28 May 2014 14:34:00 +0000 (16:34 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 30 May 2014 08:06:30 +0000 (10:06 +0200)
OC.Share can be used in non-files apps, so the fileList callback needs
to support that as well.

core/js/share.js

index 894f0d488f4fa6500449c060e522d631ef590782..90f6c7fdc7c46b780c506876cba0c8545d75ad30 100644 (file)
@@ -37,9 +37,16 @@ OC.Share={
         */
        updateIcons:function(itemType, fileList){
                var item;
-               fileList = fileList || OCA.Files.App.fileList;
-               var $fileList = fileList.$fileList;
-               var currentDir = fileList.getCurrentDirectory();
+               var $fileList;
+               var currentDir;
+               if (!fileList && OCA.Files) {
+                       fileList = OCA.Files.App.fileList;
+               }
+               // fileList is usually only defined in the files app
+               if (fileList) {
+                       $fileList = fileList.$fileList;
+                       currentDir = fileList.getCurrentDirectory();
+               }
                for (item in OC.Share.statuses){
                        var image;
                        var data = OC.Share.statuses[item];