diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-31 13:06:32 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-31 13:06:32 -0400 |
commit | 8d01e1a3555e303deed72636d0d7fabce447cf1c (patch) | |
tree | bbe64b4f39efeec034e1255f5b05cd87dcc47448 /core/js/share.js | |
parent | 8729119d4baa6a9c7f27314b175b67dc3693ebdd (diff) | |
download | nextcloud-server-8d01e1a3555e303deed72636d0d7fabce447cf1c.tar.gz nextcloud-server-8d01e1a3555e303deed72636d0d7fabce447cf1c.zip |
Don't show self or already shared with users and groups in the share with search
Diffstat (limited to 'core/js/share.js')
-rw-r--r-- | core/js/share.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js index 811f9007087..44abc14ede4 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -8,7 +8,7 @@ OC.Share={ PERMISSION_UPDATE:2, PERMISSION_DELETE:8, PERMISSION_SHARE:16, - item:[], + itemShares:[], statuses:[], loadIcons:function(itemType) { // Load all share icons @@ -91,6 +91,7 @@ OC.Share={ OC.Share.showPrivateLink(item, share.share_with); } else { OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions); + } }); } @@ -99,7 +100,7 @@ OC.Share={ // if (cache[search.term]) { // response(cache[search.term]); // } else { - $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term }, function(result) { + $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term, itemShares: OC.Share.itemShares }, function(result) { if (result.status == 'success' && result.data.length > 0) { response(result.data); } else { @@ -136,6 +137,10 @@ OC.Share={ }); }, addShareWith:function(shareType, shareWith, permissions, possiblePermissions) { + if (!OC.Share.itemShares[shareType]) { + OC.Share.itemShares[shareType] = []; + } + OC.Share.itemShares[shareType].push(shareWith); var editChecked = createChecked = updateChecked = deleteChecked = shareChecked = ''; if (permissions & OC.Share.PERMISSION_CREATE) { createChecked = 'checked="checked"'; |