summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-04 17:49:42 +0200
committerVincent Petry <pvince81@owncloud.com>2013-10-04 17:49:42 +0200
commit0736bfb43a0ecc81ba1eb38c4b32fea8ed454957 (patch)
tree2a4c37ff8c4af708576c4d2152b39270e48f85d1 /apps
parentfd34c969d233724399651f6481f32d5c7c1ee18b (diff)
downloadnextcloud-server-0736bfb43a0ecc81ba1eb38c4b32fea8ed454957.tar.gz
nextcloud-server-0736bfb43a0ecc81ba1eb38c4b32fea8ed454957.zip
Do not call changeDirectory() when no dir set on breadcrumb
Some apps like the files_trashbin app do not set a directory on its "home" breadcrumb link. This fix makes sure that the click event doesn't do anything in that case and lets the browser open the link. This fixes the "home" icon in the trashbin app which now correctly reopens the files app.
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/files.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 899bc6469e5..09f5d6f114c 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -701,7 +701,10 @@ function checkTrashStatus() {
}
function onClickBreadcrumb(e){
- var $el = $(e.target).closest('.crumb');
- e.preventDefault();
- FileList.changeDirectory(decodeURIComponent($el.data('dir')));
+ var $el = $(e.target).closest('.crumb'),
+ $targetDir = $el.data('dir');
+ if ($targetDir !== undefined){
+ e.preventDefault();
+ FileList.changeDirectory(decodeURIComponent($targetDir));
+ }
}