diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-07 15:33:30 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-07 15:38:56 +0100 |
commit | 07d027feebb90ea6b93a4ca3df82ec3a86f6d495 (patch) | |
tree | f6c5d10e405798fbdbf7c6e596fbeced50405741 /apps | |
parent | b39a17e49969a626ba561917dc24cfb76b9fcdbc (diff) | |
download | nextcloud-server-07d027feebb90ea6b93a4ca3df82ec3a86f6d495.tar.gz nextcloud-server-07d027feebb90ea6b93a4ca3df82ec3a86f6d495.zip |
Show link icon when shared by link
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/sharebreadcrumbview.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/apps/files_sharing/js/sharebreadcrumbview.js b/apps/files_sharing/js/sharebreadcrumbview.js index 6f1e0f5ee1b..3492259c0c8 100644 --- a/apps/files_sharing/js/sharebreadcrumbview.js +++ b/apps/files_sharing/js/sharebreadcrumbview.js @@ -25,15 +25,12 @@ (function() { 'use strict'; - var TEMPLATE = '<span class="icon-share {{#if isShared}}shared{{/if}}"></span>'; - var BreadCrumbView = OC.Backbone.View.extend({ tagName: 'span', events: { click: '_onClick' }, _dirInfo: undefined, - _template: undefined, /** @type OCA.Sharing.ShareTabView */ _shareTab: undefined, @@ -42,24 +39,26 @@ this._shareTab = options.shareTab; }, - template: function(data) { - if (!this._template) { - this._template = Handlebars.compile(TEMPLATE); - } - return this._template(data); - }, render: function(data) { this._dirInfo = data.dirInfo || null; if (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) { var isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0; - this.$el.html(this.template({ - isShared: isShared - })); + this.$el.removeClass('shared icon-public icon-share'); + if (isShared) { + this.$el.addClass('shared'); + if (data.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK) !== -1) { + this.$el.addClass('icon-public'); + } else { + this.$el.addClass('icon-share'); + } + } else { + this.$el.addClass('icon-share'); + } this.$el.show(); this.delegateEvents(); } else { - this.$el.empty(); + this.$el.removeClass('shared icon-public icon-share'); this.$el.hide(); } |