diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-08-21 15:00:15 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:26 +0200 |
commit | 277b786886de7979fea308595e4cf658e85aacf7 (patch) | |
tree | 22c923f2e96d14a6d5dc328c3fe2d6631e0e8c2c | |
parent | dcb084a617b2ee24031a14bce8b8e9749c821b75 (diff) | |
download | nextcloud-server-277b786886de7979fea308595e4cf658e85aacf7.tar.gz nextcloud-server-277b786886de7979fea308595e4cf658e85aacf7.zip |
ShareDialogResharerInfoView improvements
-rw-r--r-- | core/js/sharedialogresharerinfoview.js | 8 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 8 | ||||
-rw-r--r-- | core/js/shareitemmodel.js | 3 |
3 files changed, 10 insertions, 9 deletions
diff --git a/core/js/sharedialogresharerinfoview.js b/core/js/sharedialogresharerinfoview.js index 3f996bb6d21..8970d857fc3 100644 --- a/core/js/sharedialogresharerinfoview.js +++ b/core/js/sharedialogresharerinfoview.js @@ -51,8 +51,7 @@ initialize: function(options) { var view = this; - //FIXME: specific to reshares stuff - this.model.on('change', function() { + this.model.on('change:reshare', function() { view.render(); }); @@ -67,7 +66,7 @@ if ( !this.model.hasReshare() || !this.model.getReshareOwner() !== OC.currentUser) { - this.$el.html(''); + this.$el.empty(); return this; } @@ -91,7 +90,8 @@ ); } - this.$el.html(reshareTemplate({ + this.$el.empty(); + this.$el.append(reshareTemplate({ avatarEnabled: this.configModel.areAvatarsEnabled(), sharedByText: sharedByText })); diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 179d818e90f..67017778632 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -14,7 +14,7 @@ } var TEMPLATE_BASE = - '{{{resharerInfo}}}' + + '<div class="resharerInfo"></div>' + '<label for="shareWith" class="hidden-visually">{{shareLabel}}</label>' + '<div class="oneline">' + ' <input id="shareWith" type="text" placeholder="{{sharePlaceholder}}" />' + @@ -135,11 +135,8 @@ render: function() { var baseTemplate = this._getTemplate('base', TEMPLATE_BASE); - this.resharerInfoView.render(); - this.$el.html(baseTemplate({ shareLabel: t('core', 'Share'), - resharerInfo: this.resharerInfoView.el.innerHTML, sharePlaceholder: this._renderSharePlaceholderPart(), remoteShareInfo: this._renderRemoteShareInfoPart(), linkShare: this._renderLinkSharePart(), @@ -148,6 +145,9 @@ expiration: this._renderExpirationPart() })); + this.resharerInfoView.$el = this.$el.find('.resharerInfo'); + this.resharerInfoView.render(); + this.$el.find('.hasTooltip').tooltip(); if(this.configModel.areAvatarsEnabled()) { this.$el.find('.avatar').avatar(this.model.getReshareOwner, 32); diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 0d2bce8b2ef..9c4a8141cda 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -90,7 +90,8 @@ * @returns {boolean} */ hasReshare: function() { - return _.isObject(this.get('reshare')) && !_.isUndefined(this.get('reshare').uid_owner); + var reshare = this.get('reshare'); + return _.isObject(reshare) && !_.isUndefined(reshare.uid_owner); }, /** |