summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-12-14 10:44:47 +0100
committerVincent Petry <pvince81@owncloud.com>2015-12-14 10:44:47 +0100
commit4d9e12b8bcc09a3b75a847523876ad961cab1de3 (patch)
tree61d390e53a64e3cc313665f46a1e9f360fd9227a /apps/files/js/filelist.js
parent74de12c698e01514c8fe42727d98aeaa8956eeee (diff)
downloadnextcloud-server-4d9e12b8bcc09a3b75a847523876ad961cab1de3.tar.gz
nextcloud-server-4d9e12b8bcc09a3b75a847523876ad961cab1de3.zip
Fix mount type root detection
Since Webdav doesn't contain that information, we need to rely on the parent folder's mount type to find out whether a child item is a shared/external root or not. Fixed the mount type detection logic and added unit test. Also added a fix that ignores detection if no parent folder exists (ex: shared file list, favorites, etc)
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 672c39a8bb1..7e1329d1155 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -990,13 +990,16 @@
}
if (fileData.mountType) {
- // FIXME: HACK: detect shared-root
- if (fileData.mountType === 'shared' && this.dirInfo.mountType !== 'shared') {
- // if parent folder isn't share, assume the displayed folder is a share root
- fileData.mountType = 'shared-root';
- } else if (fileData.mountType === 'external' && this.dirInfo.mountType !== 'external') {
- // if parent folder isn't external, assume the displayed folder is the external storage root
- fileData.mountType = 'external-root';
+ // dirInfo (parent) only exist for the "real" file list
+ if (this.dirInfo.id) {
+ // FIXME: HACK: detect shared-root
+ if (fileData.mountType === 'shared' && this.dirInfo.mountType !== 'shared' && this.dirInfo.mountType !== 'shared-root') {
+ // if parent folder isn't share, assume the displayed folder is a share root
+ fileData.mountType = 'shared-root';
+ } else if (fileData.mountType === 'external' && this.dirInfo.mountType !== 'external' && this.dirInfo.mountType !== 'external-root') {
+ // if parent folder isn't external, assume the displayed folder is the external storage root
+ fileData.mountType = 'external-root';
+ }
}
tr.attr('data-mounttype', fileData.mountType);
}