From a5b0ea031de3036fc75c3b1d6b3c030a824c1736 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 14 Sep 2015 01:24:21 +0200 Subject: make unshare work --- core/js/shareitemmodel.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'core/js/shareitemmodel.js') diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 3569c6ffd1a..dabcc65c0a1 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -121,15 +121,7 @@ }, removeLinkShare: function() { - var model = this; - var itemType = this.get('itemType'); - var itemSource = this.get('itemSource'); - - OC.Share.unshare(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', function() { - model.fetch(); - //FIXME: updateIcon belongs to view - OC.Share.updateIcon(itemType, itemSource); - }); + this.removeShare(OC.Share.SHARE_TYPE_LINK, ''); }, setPublicUpload: function(allow) { @@ -179,6 +171,18 @@ }); }, + removeShare: function(shareType, shareWith) { + var model = this; + var itemType = this.get('itemType'); + var itemSource = this.get('itemSource'); + + OC.Share.unshare(itemType, itemSource, shareType, shareWith, function() { + model.fetch(); + //FIXME: updateIcon belongs to view + OC.Share.updateIcon(itemType, itemSource); + }); + }, + /** * @returns {boolean} */ -- cgit v1.2.3