summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogshareelistview.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-09-14 01:24:21 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:28 +0200
commita5b0ea031de3036fc75c3b1d6b3c030a824c1736 (patch)
tree1b02b52842ccf93e9ac964a985b8afc6c2aabf42 /core/js/sharedialogshareelistview.js
parent7ae84e0e5c60a5b891dcc4183b0a1cff83f36090 (diff)
downloadnextcloud-server-a5b0ea031de3036fc75c3b1d6b3c030a824c1736.tar.gz
nextcloud-server-a5b0ea031de3036fc75c3b1d6b3c030a824c1736.zip
make unshare work
Diffstat (limited to 'core/js/sharedialogshareelistview.js')
-rw-r--r--core/js/sharedialogshareelistview.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 895f14508d5..dda2fe949ac 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -212,6 +212,9 @@
});
}
+ var view = this;
+ this.$el.find('.unshare').click(function() { view.onUnshare(this, view); });
+
return this;
},
@@ -224,6 +227,24 @@
this._template = Handlebars.compile(TEMPLATE);
}
return this._template;
+ },
+
+ onUnshare: function(element, view) {
+ var $element = $(element);
+
+ if($element.hasClass('icon-loading-small')) {
+ // in process
+ return;
+ }
+ $element.empty().addClass('icon-loading-small');
+
+ var $li = $element.closest('li');
+ var shareType = $li.data('share-type');
+ var shareWith = $li.attr('data-share-with');
+
+ view.model.removeShare(shareType, shareWith);
+
+ return false;
}
});