diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-09-14 17:47:47 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:28 +0200 |
commit | 06b11dd602b5073d383d14e10072708907513cb3 (patch) | |
tree | c210dfa045cbe5ea1dffe736ef98b457eb6a7434 /core/js/sharedialogview.js | |
parent | e90065881d47a64b6c376208ece208932711c765 (diff) | |
download | nextcloud-server-06b11dd602b5073d383d14e10072708907513cb3.tar.gz nextcloud-server-06b11dd602b5073d383d14e10072708907513cb3.zip |
Fix shares list events
Some events need preventing default like unshare, but setting
permissions doesn't.
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r-- | core/js/sharedialogview.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 416fff53de4..c0020d5b031 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -102,7 +102,7 @@ : options[name]; } - _.bindAll(this, 'autocompleteHandler'); + _.bindAll(this, 'autocompleteHandler', '_onSelectRecipient'); }, autocompleteHandler: function (search, response) { @@ -151,6 +151,11 @@ .appendTo(ul); }, + _onSelectRecipient: function(e, s) { + e.preventDefault(); + this.model.addShare(s.item.value); + }, + render: function() { var baseTemplate = this._getTemplate('base', TEMPLATE_BASE); @@ -165,15 +170,7 @@ minLength: 2, delay: 750, source: this.autocompleteHandler, - select: function(e, s) { - var expiration = ''; - if($('#expirationCheckbox').is(':checked') === true) { - expiration = view.$el.find('#expirationDate').val() - } - view.model.addShare(e, s, { - expiration: expiration - }); - } + select: this._onSelectRecipient }).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem; this.resharerInfoView.$el = this.$el.find('.resharerInfoView'); |