From cb19fdd55bae285994540f5a7cb3f075317d50fe Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 25 Jun 2012 19:27:57 -0400 Subject: Show users and groups shared with in dropdown --- core/js/share.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'core/js') diff --git a/core/js/share.js b/core/js/share.js index 73a7ff86c2d..96ea3077303 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -1,4 +1,7 @@ OC.Share={ + SHARE_TYPE_USER:0, + SHARE_TYPE_GROUP:1, + SHARE_TYPE_PRIVATE_LINK:3, item:[], statuses:[], loadIcons:function(itemType) { @@ -21,11 +24,15 @@ OC.Share={ }); }, loadItem:function(itemType, item) { - $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getItemShared', itemType: itemType, item: item }, function(result) { + var data = ''; + $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItemShared', itemType: itemType, item: item }, async: false, success: function(result) { if (result && result.status === 'success') { - OC.Share.item = result.data; + data = result.data; + } else { + data = false; } - }); + }}); + return data; }, share:function(itemType, item, shareType, shareWith, permissions, callback) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'share', itemType: itemType, item: item, shareType: shareType, shareWith: shareWith, permissions: permissions }, function(result) { @@ -57,17 +64,17 @@ OC.Share={ }); }, showDropDown:function(itemType, item, appendTo) { - OC.Share.loadItem(item); var html = '