From 4036b479f99eb91fcc8bfd4a2428cc4f44c3220f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Dec 2018 11:48:29 +0300 Subject: share plugin: fix unshare() --- plugins/share/share.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'plugins/share') 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); + } }); } -- cgit v1.2.3