summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-05 13:58:18 +0300
committerAndrew Dolgov <[email protected]>2018-12-05 13:58:18 +0300
commitb65d8384c23bfbbd3db41a621cd80b5b45c8131b (patch)
tree87d042813528fd7e31380a1c1fcf6e18a1e8e384 /js
parent89b213b4bbe861cbe16f49f7554eb7c0b9b32416 (diff)
update headlines to use vector icons
Diffstat (limited to 'js')
-rwxr-xr-xjs/Headlines.js25
1 files changed, 2 insertions, 23 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index 99ce39150..9da7f7149 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -498,19 +498,9 @@ define(["dojo/_base/declare"], function (declare) {
const row = $("RROW-" + id);
if (row) {
- const imgs = $$("img[class*=marked-pic][class*=marked-" + id + "]");
-
- imgs.each((img) => {
- if (!row.hasClassName("marked")) {
- img.src = img.src.replace("mark_unset", "mark_set");
- query.mark = 1;
- } else {
- img.src = img.src.replace("mark_set", "mark_unset");
- query.mark = 0;
- }
- });
row.toggleClassName("marked");
+ query.mark = row.hasClassName("marked") ? 1 : 0;
if (!client_only)
xhrPost("backend.php", query, (transport) => {
@@ -524,19 +514,8 @@ define(["dojo/_base/declare"], function (declare) {
if (row) {
const query = {op: "rpc", id: id, method: "publ"};
- const imgs = $$("img[class*=pub-pic][class*=pub-" + id + "]");
-
- imgs.each((img) => {
- if (!row.hasClassName("published")) {
- img.src = img.src.replace("pub_unset", "pub_set");
- query.pub = 1;
- } else {
- img.src = img.src.replace("pub_set", "pub_unset");
- query.pub = 0;
- }
- });
-
row.toggleClassName("published");
+ query.pub = row.hasClassName("published") ? 1 : 0;
if (!client_only)
xhrPost("backend.php", query, (transport) => {