summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogview.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-15 15:29:30 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:29 +0200
commit996639f4fbd4107851efc11ee34b24cead43e790 (patch)
tree9351ddf424d608b71ecf50715105b7af1131487d /core/js/sharedialogview.js
parent886f1ed660e91edb8f370cf711ed395fdff7dc30 (diff)
downloadnextcloud-server-996639f4fbd4107851efc11ee34b24cead43e790.tar.gz
nextcloud-server-996639f4fbd4107851efc11ee34b24cead43e790.zip
More unit tests for share dialog
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r--core/js/sharedialogview.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 36e63993203..8c390ee5450 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -15,6 +15,7 @@
var TEMPLATE_BASE =
'<div class="resharerInfoView"></div>' +
+ '{{#if isSharingAllowed}}' +
'<label for="shareWith" class="hidden-visually">{{shareLabel}}</label>' +
'<div class="oneline">' +
' <input id="shareWith" type="text" placeholder="{{sharePlaceholder}}" />' +
@@ -22,6 +23,7 @@
'</div>' +
// FIXME: find a good position for remoteShareInfo
'{{{remoteShareInfo}}}' +
+ '{{/if}}' +
'<div class="shareeListView"></div>' +
'<div class="linkShareView"></div>' +
'<div class="expirationView"></div>'
@@ -82,6 +84,9 @@
this.configModel.on('change:isRemoteShareAllowed', function() {
view.render();
});
+ this.model.on('change:permissions', function() {
+ view.render();
+ });
var subViewOptions = {
model: this.model,
@@ -163,16 +168,19 @@
this.$el.html(baseTemplate({
shareLabel: t('core', 'Share'),
sharePlaceholder: this._renderSharePlaceholderPart(),
- remoteShareInfo: this._renderRemoteShareInfoPart()
+ remoteShareInfo: this._renderRemoteShareInfoPart(),
+ isSharingAllowed: this.model.sharePermissionPossible()
}));
- var view = this;
- this.$el.find('#shareWith').autocomplete({
- minLength: 2,
- delay: 750,
- source: this.autocompleteHandler,
- select: this._onSelectRecipient
- }).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem;
+ var $shareField = this.$el.find('#shareWith');
+ if ($shareField.length) {
+ $shareField.autocomplete({
+ minLength: 2,
+ delay: 750,
+ source: this.autocompleteHandler,
+ select: this._onSelectRecipient
+ }).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem;
+ }
this.resharerInfoView.$el = this.$el.find('.resharerInfoView');
this.resharerInfoView.render();