summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorGreg <supahgreg@users.noreply.github.com>2025-10-14 19:13:51 -0500
committerGitHub <noreply@github.com>2025-10-14 19:13:51 -0500
commit703d310e400f1f4162d4e38afa3f5bf5169c5377 (patch)
treeb4ab637f1b25aae25cd10604468d509bbe26246e /plugins/share
parent73f9d7bd6c8f222145c29c91eeb43ba7c7677496 (diff)
parent6223abef082bc7d2383ecbd4cf42fd280073f5d1 (diff)
Merge pull request #51 from tt-rss/js-proto-extensions-and-misc-cleanup
Remove various JS prototype extensions and alias functions
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/share.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/plugins/share/share.js b/plugins/share/share.js
index f27e06678..0ae4b2031 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -23,10 +23,7 @@ Plugins.Share = {
target.href = target.href.replace(/&key=.*$/,
"&key=" + new_link);
- const icon = document.querySelector(".share-icon-" + id);
-
- if (icon)
- icon.addClassName("is-shared");
+ document.querySelector('.share-icon-' + id)?.classList.add('is-shared');
Notify.close();
@@ -42,12 +39,7 @@ Plugins.Share = {
if (confirm(__("Remove sharing for this article?"))) {
xhr.post("backend.php", App.getPhArgs("share", "unshare", {id: id}), (reply) => {
Notify.info(reply);
-
- const icon = document.querySelector(".share-icon-" + id);
-
- if (icon)
- icon.removeClassName("is-shared");
-
+ document.querySelector('.share-icon-' + id)?.classList.remove('is-shared');
dialog.hide();
});
}
@@ -61,11 +53,7 @@ Plugins.Share = {
xhr.post("backend.php", App.getPhArgs("share", "shareDialog", {id: id}), (reply) => {
dialog.attr('content', reply)
-
- const icon = document.querySelector(".share-icon-" + id);
-
- if (icon)
- icon.addClassName("is-shared");
+ document.querySelector('.share-icon-' + id)?.classList.add('is-shared');
});
});