diff options
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'); |