summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-09 11:48:29 +0300
committerAndrew Dolgov <[email protected]>2018-12-09 11:48:29 +0300
commit4036b479f99eb91fcc8bfd4a2428cc4f44c3220f (patch)
treeb3c5dfc3ab5860064bba86a457a447496fc73049 /plugins/share
parent703351c79e86cc6bb357bd40f7dc75a7da1e7a51 (diff)
share plugin: fix unshare()
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/share.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/share/share.js b/plugins/share/share.js
index c30dd03e0..c49f64b4b 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -47,17 +47,21 @@ Plugins.Share = {
unshare: function () {
if (confirm(__("Remove sharing for this article?"))) {
- Notify.progress("Trying to unshare...", true);
-
const query = {op: "pluginhandler", plugin: "share", method: "unshare", id: id};
xhrPost("backend.php", query, () => {
- notify("Article unshared.");
+ try {
+ const img = $("SHARE-IMG-" + id);
- const img = $("SHARE-IMG-" + id);
- img.removeClassName("shared");
+ if (img) {
+ img.removeClassName("shared");
+ img.up("div[id*=RROW]").removeClassName("shared");
+ }
- dialog.hide();
+ dialog.hide();
+ } catch (e) {
+ console.error(e);
+ }
});
}