diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-08-12 17:30:20 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-08-12 17:30:20 +0200 |
commit | c964eff17b1a7feeab794f6035a7beff8143ac85 (patch) | |
tree | 0434d46c76dc42c0b8ba9323d7aff600fa320428 /apps/files_sharing/js | |
parent | 997577cf7a5edc076c4039a7fc7c1c08c050a996 (diff) | |
download | nextcloud-server-c964eff17b1a7feeab794f6035a7beff8143ac85.tar.gz nextcloud-server-c964eff17b1a7feeab794f6035a7beff8143ac85.zip |
Make file actions work from sidebar
The favorite icon in the sidebar now triggers the file action and also
updates itself according to the model's state when triggered from the
file row.
The thumbnail triggers the default action.
Currently only one FileInfoModel is used for the selection and state
synchronization between views.
FileList reload now auto-closes the sidebar.
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/sharetabview.js | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js index e02de923751..5f4a21a4a57 100644 --- a/apps/files_sharing/js/sharetabview.js +++ b/apps/files_sharing/js/sharetabview.js @@ -13,29 +13,14 @@ '<div>Owner: {{owner}}'; /** - * @class OCA.Sharing.ShareTabView - * @classdesc - * - * Displays sharing information - * - */ - var ShareTabView = function(id) { - this.initialize(id); - }; - /** * @memberof OCA.Sharing */ - ShareTabView.prototype = _.extend({}, OCA.Files.DetailTabView.prototype, + var ShareTabView = OCA.Files.DetailTabView.extend( /** @lends OCA.Sharing.ShareTabView.prototype */ { - _template: null, + id: 'shareTabView', + className: 'tab shareTabView', - /** - * Initialize the details view - */ - initialize: function() { - OCA.Files.DetailTabView.prototype.initialize.apply(this, arguments); - this.$el.addClass('shareTabView'); - }, + _template: null, getLabel: function() { return t('files_sharing', 'Sharing'); @@ -51,9 +36,9 @@ this._template = Handlebars.compile(TEMPLATE); } - if (this._fileInfo) { + if (this.model) { this.$el.append(this._template({ - owner: this._fileInfo.shareOwner || OC.currentUser + owner: this.model.get('shareOwner') || OC.currentUser })); } else { |