diff options
author | Andrew Dolgov <[email protected]> | 2021-02-19 15:34:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-19 15:34:28 +0300 |
commit | 921b5ca2ceb36428cab48c5da6fc6137ed79f4b2 (patch) | |
tree | 1a7717dd1fba7fd2c09831db177085c2ce4a3587 /js/Headlines.js | |
parent | e73779fec18a417ac04d694f75b6f9bbce0f47ea (diff) |
add onTagsUpdated similar to onLabelsUpdated
Diffstat (limited to 'js/Headlines.js')
-rwxr-xr-x | js/Headlines.js | 11 |
1 files changed, 11 insertions, 0 deletions
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) { |