diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 14:20:50 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 14:20:50 -0400 |
commit | c65046773dc2a594184e626dd7a29e52b58c14be (patch) | |
tree | 7529a1d12eb10fef7c06f02f7d44e6c17f74018c /apps | |
parent | 6d25943f2f060c9325ba7a54ca419e9394f3b982 (diff) | |
download | nextcloud-server-c65046773dc2a594184e626dd7a29e52b58c14be.tar.gz nextcloud-server-c65046773dc2a594184e626dd7a29e52b58c14be.zip |
Make unshare work from dropdown
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/ajax/unshare.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/apps/files_sharing/ajax/unshare.php b/apps/files_sharing/ajax/unshare.php index 78d7d2e25f0..b9230d257b7 100644 --- a/apps/files_sharing/ajax/unshare.php +++ b/apps/files_sharing/ajax/unshare.php @@ -4,7 +4,7 @@ $RUNTIME_NOAPPS = true; require_once('../../../lib/base.php'); require_once('../lib_share.php'); -$source = $_GET['source']; +$source = "/".OC_User::getUser()."/files".$_GET['source']; $uid_shared_with = $_GET['uid_shared_with']; OC_Share::unshare($source, $uid_shared_with); diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index ce3e1193bc2..7931f00fb68 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -33,7 +33,7 @@ $(document).ready(function() { if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) { if ($('#dropdown').is(':visible')) { $('#dropdown').hide('blind', function() { - $('#dropdown').remove(); + $('#dropdown').remove();S $('tr').removeClass('mouseOver'); }); } @@ -51,7 +51,7 @@ $(document).ready(function() { cache: false, data: data, success: function() { - addUser(uid_shared_with, 0, false); + addUser(uid_shared_with, permissions, false); } }); }); @@ -80,13 +80,12 @@ $(document).ready(function() { data: data }); }); - + $('.unshare').live('click', function(event) { - // TODO Fix unshare event.preventDefault(); - event.stopPropagation(); + var user = $(this).parent(); var source = $('#dropdown').data('file'); - var uid_shared_with = $(this).parent().data('uid_shared_with'); + var uid_shared_with = user.data('uid_shared_with'); var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with); $.ajax({ type: 'GET', @@ -94,7 +93,10 @@ $(document).ready(function() { cache: false, data: data, success: function() { - $(this).parent().remove(); + var option = "<option value='"+uid_shared_with+"'>"+uid_shared_with+"</option>"; + $(user).remove(); + $(option).appendTo('#share_with'); + $('#share_with').trigger('liszt:updated'); } }); }); |