make rendered labels clickable

This commit is contained in:
Andrew Dolgov 2021-03-07 12:02:23 +03:00
parent c036c27ec7
commit 1dcc36deca
1 changed files with 9 additions and 4 deletions

View File

@ -144,10 +144,15 @@ const Article = {
).join(", ") : `${__("no tags")}`}</span>`; ).join(", ") : `${__("no tags")}`}</span>`;
}, },
renderLabels: function(id, labels) { renderLabels: function(id, labels) {
return `<span class="labels" data-labels-for="${id}">${labels.map((label) => ` return `<span class="labels" data-labels-for="${id}">
<span class="label" data-label-id="${label[0]}" ${labels.map((label) => `
style="color : ${label[2]}; background-color : ${label[3]}">${App.escapeHtml(label[1])}</span>` <a href="#" class="label" data-label-id="${label[0]}"
).join("")}</span>`; style="color : ${label[2]}; background-color : ${label[3]}"
onclick="event.stopPropagation(); Feeds.open({feed:'${label[0]}'})">
${App.escapeHtml(label[1])}
</a>`
).join("")}
</span>`;
}, },
renderEnclosures: function (enclosures) { renderEnclosures: function (enclosures) {
return ` return `