diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-14 11:45:04 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-21 15:02:20 +0200 |
commit | 4e08d8342e8582e8001df31ff6e56f40d20ccc40 (patch) | |
tree | 09d4e98bbb21c5a80effe2906ddd4c5f70f8e75c /core/js/sharedialogshareelistview.js | |
parent | 72d24555773aeffd2481b59e54e866632a1c763c (diff) | |
download | nextcloud-server-4e08d8342e8582e8001df31ff6e56f40d20ccc40.tar.gz nextcloud-server-4e08d8342e8582e8001df31ff6e56f40d20ccc40.zip |
UI set share note!
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/js/sharedialogshareelistview.js')
-rw-r--r-- | core/js/sharedialogshareelistview.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 53a65fcdf7a..af4abce17b6 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -121,6 +121,9 @@ '</span>' + '</li>' + '<li>' + + '<a href="#" class="addnote"><span class="icon-loading-small hidden"></span><span class="icon icon-edit"></span><span>{{addNoteLabel}}</span></a>' + + '</li>' + + '<li>' + '<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span>{{unshareLabel}}</span></a>' + '</li>' + '</ul>' + @@ -154,8 +157,11 @@ /** @type {boolean|number} **/ _renderPermissionChange: false, + _noteView: undefined, + events: { 'click .unshare': 'onUnshare', + 'click .addnote': 'showNoteForm', 'click .icon-more': 'onToggleMenu', 'click .permissions': 'onPermissionChange', 'click .expireDate' : 'onExpireDateChange', @@ -178,6 +184,8 @@ this.model.on('change:shares', function() { view.render(); }); + + this._noteView = options.parent.noteView; }, /** @@ -269,6 +277,7 @@ getShareProperties: function() { return { unshareLabel: t('core', 'Unshare'), + addNoteLabel: t('core', 'Set share note'), canShareLabel: t('core', 'Can reshare'), canEditLabel: t('core', 'Can edit'), createPermissionLabel: t('core', 'Can create'), @@ -470,6 +479,16 @@ return this._popoverMenuTemplate(data); }, + showNoteForm(event) { + event.preventDefault(); + event.stopPropagation(); + var self = this; + var $element = $(event.target); + var $li = $element.closest('li[data-share-id]'); + var shareId = $li.data('share-id'); + this._noteView.render(shareId); + }, + onUnshare: function(event) { event.preventDefault(); event.stopPropagation(); @@ -493,6 +512,8 @@ self.model.removeShare(shareId) .done(function() { $li.remove(); + // remove note field on sucess + self._noteView.hide(); }) .fail(function() { $loading.addClass('hidden'); |