summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogview.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-14 17:47:47 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:28 +0200
commit06b11dd602b5073d383d14e10072708907513cb3 (patch)
treec210dfa045cbe5ea1dffe736ef98b457eb6a7434 /core/js/sharedialogview.js
parente90065881d47a64b6c376208ece208932711c765 (diff)
downloadnextcloud-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.js17
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');