From 921b5ca2ceb36428cab48c5da6fc6137ed79f4b2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 15:34:28 +0300 Subject: add onTagsUpdated similar to onLabelsUpdated --- js/Headlines.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/Headlines.js') diff --git a/js/Headlines.js b/js/Headlines.js index f98b3dcce..9bc5747c2 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -1240,6 +1240,17 @@ const Headlines = { } } }, + onTagsUpdated: function (data) { + if (data) { + if (this.headlines[data.id]) { + this.headlines[data.id].tags = data.tags; + } + + App.findAll(`span[data-tags-for="${data.id}"`).forEach((ctr) => { + ctr.innerHTML = Article.renderTags(data.id, data.tags); + }); + } + }, // TODO: maybe this should cause article to be rendered again, although it might cause flicker etc onLabelsUpdated: function (data) { if (data) { -- cgit v1.2.3-54-g00ecf