diff --git a/apps/files_sharing/css/sharing.css b/apps/files_sharing/css/sharing.css index d4fcf79ee98..a2fa870c437 100644 --- a/apps/files_sharing/css/sharing.css +++ b/apps/files_sharing/css/sharing.css @@ -6,9 +6,9 @@ -moz-box-shadow:0 1px 1px #777; -webkit-box-shadow:0 1px 1px #777; box-shadow:0 1px 1px #777; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } -#sharedWithList { padding:0.5em; list-style-type: none; } +#shareWithList { padding:0.5em; list-style-type: none; } #privateLink { border-top:1px solid #ddd; padding-top:0.5em; } -a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; } +a.unshare { float:right; display:inline; padding:.3em 0 0 .3em !important; opacity:.5; } a.unshare:hover { opacity:1; } #share_with { width: 16em; } #privateLink label, .edit { font-weight:normal; } diff --git a/core/ajax/share.php b/core/ajax/share.php index b1b619e6220..f9ab91b9d2b 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -47,7 +47,8 @@ if (isset($_POST['action'])) { $return = OCP\Share::getItemsShared($_GET['itemType'], OCP\Share::FORMAT_STATUSES); ($return) ? OC_JSON::success(array('data' => $return)) : OC_JSON::error(); break; - case 'getItemShared': + case 'getItem': + // TODO Check if the item was shared to the current user $return = OCP\Share::getItemShared($_GET['itemType'], $_GET['item']); ($return) ? OC_JSON::success(array('data' => $return)) : OC_JSON::error(); break; diff --git a/core/js/share.js b/core/js/share.js index bcad906262a..685932f6730 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -25,7 +25,7 @@ OC.Share={ }, loadItem:function(itemType, item) { var data = ''; - $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItemShared', itemType: itemType, item: item }, async: false, success: function(result) { + $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, item: item }, async: false, success: function(result) { if (result && result.status === 'success') { data = result.data; } else { @@ -45,8 +45,8 @@ OC.Share={ } }); }, - unshare:function(itemType, shareType, shareWith, callback) { - $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'unshare', itemType: itemType, shareType: shareType, shareWith: shareWith }, function(result) { + unshare:function(itemType, item, shareType, shareWith, callback) { + $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'unshare', itemType: itemType, item: item, shareType: shareType, shareWith: shareWith }, function(result) { if (result && result.status === 'success') { if (callback) { callback(); @@ -67,15 +67,8 @@ OC.Share={ var html = '