aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-10-04 12:56:04 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-07 14:58:45 +0100
commitc5597baf88c3f7bcea9c03a3fa35e1dc81e12bd5 (patch)
treeb2d88ae33f7e99207913afd71dfdc9851485f8b5 /apps/files/js
parent1857e50259e3cedffd9d9c24ce2a47bf08ebf782 (diff)
downloadnextcloud-server-c5597baf88c3f7bcea9c03a3fa35e1dc81e12bd5.tar.gz
nextcloud-server-c5597baf88c3f7bcea9c03a3fa35e1dc81e12bd5.zip
show whether the current folder was shared or not
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/breadcrumb.js23
-rw-r--r--apps/files/js/filelist.js10
2 files changed, 33 insertions, 0 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js
index 98de7aa374c..ff9700456da 100644
--- a/apps/files/js/breadcrumb.js
+++ b/apps/files/js/breadcrumb.js
@@ -45,6 +45,7 @@
if (options.getCrumbUrl) {
this.getCrumbUrl = options.getCrumbUrl;
}
+ this._detailViews = [];
};
/**
* @memberof OCA.Files
@@ -52,6 +53,7 @@
BreadCrumb.prototype = {
$el: null,
dir: null,
+ dirInfo: null,
/**
* Total width of all breadcrumbs
@@ -79,6 +81,20 @@
}
},
+ setDirectoryInfo: function(dirInfo) {
+ if (dirInfo !== this.dirInfo) {
+ this.dirInfo = dirInfo;
+ this.render();
+ }
+ },
+
+ /**
+ * @param {Backbone.View} detailView
+ */
+ addDetailView: function(detailView) {
+ this._detailViews.push(detailView);
+ },
+
/**
* Returns the full URL to the given directory
*
@@ -122,6 +138,13 @@
}
$crumb.addClass('last');
+ _.each(this._detailViews, function(view) {
+ view.render({
+ dirInfo: this.dirInfo
+ });
+ $crumb.append(view.$el);
+ }, this);
+
// in case svg is not supported by the browser we need to execute the fallback mechanism
if (!OC.Util.hasSVGSupport()) {
OC.Util.replaceSVG(this.$el);
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 18534db3ee9..8d0e492643f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1646,6 +1646,7 @@
// first entry is the root
this.dirInfo = result.shift();
+ this.breadcrumb.setDirectoryInfo(this.dirInfo);
if (this.dirInfo.permissions) {
this.setDirectoryPermissions(this.dirInfo.permissions);
@@ -2954,6 +2955,15 @@
if (this._detailsView) {
this._detailsView.addDetailView(detailView);
}
+ },
+
+ /**
+ * Register a view to be added to the breadcrumb view
+ */
+ registerBreadCrumbDetailView: function(detailView) {
+ if (this.breadcrumb) {
+ this.breadcrumb.addDetailView(detailView);
+ }
}
};