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 = ""; + $(user).remove(); + $(option).appendTo('#share_with'); + $('#share_with').trigger('liszt:updated'); } }); }); diff --git a/files/js/files.js b/files/js/files.js index 519d48a523d..bc040b54d57 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -21,7 +21,7 @@ $(document).ready(function() { }); // Sets the file link behaviour : - $('td.filename a').live('click',function(event) { + $('td.filename.name a').live('click',function(event) { event.preventDefault(); var filename=$(this).parent().parent().data('file'); if(!FileList.isLoading(filename)){