Skip to content

Commit

Permalink
let users share the curren folder
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Oct 4, 2016
1 parent 6a5123a commit d4c34a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,16 @@
OC.Apps.showAppSidebar(this._detailsView.$el);
}

var $tr = this.findFileEl(fileName);
var model = this.getModelForFile($tr);
if (_.isObject(fileName)) {
var model = new OCA.Files.FileInfoModel(fileName);
} else {
var $tr = this.findFileEl(fileName);
var model = this.getModelForFile($tr);
$tr.addClass('highlighted');
}

this._currentFileModel = model;

$tr.addClass('highlighted');

this._detailsView.setFileInfo(model);
this._detailsView.$el.scrollTop(0);
},
Expand Down
12 changes: 12 additions & 0 deletions apps/files_sharing/js/sharebreadcrumbview.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

var BreadCrumbView = OC.Backbone.View.extend({
tagName: 'span',
events: {
click: '_onClick'
},
_dirInfo: undefined,
_template: undefined,
template: function(data) {
if (!this._template) {
Expand All @@ -41,13 +45,21 @@
return this._template(data);
},
render: function(data) {
this._dirInfo = data.dirInfo;

var isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0;

this.$el.html(this.template({
isShared: isShared
}));
this.delegateEvents();

return this;
},
_onClick: function(e) {
e.preventDefault();

OCA.Files.App.fileList.showDetailsView(this._dirInfo, 'shareTabView');
}
});

Expand Down

0 comments on commit d4c34a9

Please sign in to comment.