aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/shareitemmodel.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-09-02 16:47:25 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:27 +0200
commit60abfcdab16ed674015422a6300bd28f3baa5e91 (patch)
tree6619b8e5af3017b55123fb3fc02e5f5c488d4b13 /core/js/shareitemmodel.js
parent44ecdde10d347dc0e77576b35dc3d066dfc0fce6 (diff)
downloadnextcloud-server-60abfcdab16ed674015422a6300bd28f3baa5e91.tar.gz
nextcloud-server-60abfcdab16ed674015422a6300bd28f3baa5e91.zip
old OC.Share.addShareWith now reimplemented
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r--core/js/shareitemmodel.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index d4fbc3543a7..8afc4954902 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -350,6 +350,27 @@
});
},
+ legacyFillCurrentShares: function(shares) {
+ OC.Share.currentShares = {};
+ OC.Share.itemShares = [];
+ _.each(shares,
+ /**
+ * @param {OC.Share.Types.ShareInfo} share
+ */
+ function(share) {
+ if (!OC.Share.currentShares[share.share_type]) {
+ OC.Share.currentShares[share.share_type] = [];
+ }
+ OC.Share.currentShares[share.share_type].push(share);
+
+ if (!OC.Share.itemShares[share.share_type]) {
+ OC.Share.itemShares[share.share_type] = [];
+ }
+ OC.Share.itemShares[share.share_type].push(share.share_with);
+ }
+ );
+ },
+
parse: function(data) {
if(data === false) {
console.warn('no data was returned');
@@ -372,9 +393,12 @@
});
}
+ var shares = _.toArray(data.shares);
+ this.legacyFillCurrentShares(shares);
+
return {
reshare: data.reshare,
- shares: _.toArray(data.shares),
+ shares: shares,
permissions: permissions,
allowPublicUploadStatus: allowPublicUploadStatus
};