From cdf2dbcd523e99c3c147d29a410c9734020bb5dd Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Tue, 9 Aug 2011 10:34:00 -0400 Subject: Use chosen select form for selecting users in sharing drop down --- apps/files_sharing/js/share.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index d6cf45bf44f..f914f8da175 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -28,17 +28,21 @@ $(document).ready(function() { } createShareDropdown(filenames, files); }); - $('#uid_shared_with').live('keyup', function() { - $(this).autocomplete({ - source: OC.linkTo('files_sharing','ajax/userautocomplete.php') - }); - $('.ui-autocomplete').click(function(event) { - event.stopPropagation(); + $('#uid_shared_with').live('change', function() { + var source = $('#dropdown').data('file'); + var uid_shared_with = $(this).val(); + var permissions = 0; + var data = 'sources='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions); + $.ajax({ + type: 'POST', + url: OC.linkTo('files_sharing','ajax/share.php'), + cache: false, + data: data }); }); $('.permissions').live('change', function() { var permissions; - if (this.checked) { + if ($(this).checked) { permissions = 1; } else { permissions = 0; @@ -111,7 +115,9 @@ $(document).ready(function() { function createShareDropdown(filenames, files) { var html = "