diff options
author | Andrew Dolgov <[email protected]> | 2021-02-19 17:15:22 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-19 17:15:22 +0300 |
commit | d445530fa08cdbe2088150a3e7d23596eab9b142 (patch) | |
tree | 0c9e9a44cfd5f38835857fd961ee17c11e9e54f9 /js | |
parent | 4fa8450d38ccafdfa1117aa8a6fa570ce9fecb09 (diff) |
format note on the client
Diffstat (limited to 'js')
-rw-r--r-- | js/Article.js | 7 | ||||
-rwxr-xr-x | js/Headlines.js | 2 | ||||
-rwxr-xr-x | js/common.js | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/js/Article.js b/js/Article.js index 21973518c..d039882ec 100644 --- a/js/Article.js +++ b/js/Article.js @@ -130,6 +130,11 @@ const Article = { Headlines.toggleUnread(id, 0); }, + renderNote: function (id, note) { + return `<div class="article-note" data-note-for="${id}" style="display : ${note ? "" : "none"}"> + ${App.FormFields.icon('note')} <div onclick class='body'>${note ? App.escapeHtml(note) : ""}</div> + </div>`; + }, renderTags: function (id, tags) { const tags_short = tags.length > 5 ? tags.slice(0, 5) : tags; @@ -300,7 +305,7 @@ const Article = { <div class="buttons right">${hl.buttons}</div> </div> </div> - <div id="POSTNOTE-${hl.id}">${hl.note}</div> + ${Article.renderNote(hl.id, hl.note)} <div class="content" lang="${hl.lang ? hl.lang : 'en'}"> ${hl.content} ${Article.renderEnclosures(hl.enclosures)} diff --git a/js/Headlines.js b/js/Headlines.js index 9bc5747c2..60066164f 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -483,7 +483,7 @@ const Headlines = { </div> <div class="content" onclick="return Headlines.click(event, ${hl.id}, true);"> - <div id="POSTNOTE-${hl.id}">${hl.note}</div> + ${Article.renderNote(hl.id, hl.note)} <div class="content-inner" lang="${hl.lang ? hl.lang : 'en'}"> <img src="${App.getInitParam('icon_indicator_white')}"> </div> diff --git a/js/common.js b/js/common.js index e88b62602..e616c70ba 100755 --- a/js/common.js +++ b/js/common.js @@ -71,9 +71,9 @@ Element.prototype.fadeOut = function() { }()); }; -Element.prototype.fadeIn = function(display){ +Element.prototype.fadeIn = function(display = undefined){ this.style.opacity = 0; - this.style.display = display || "block"; + this.style.display = display == undefined ? "block" : display; const self = this; (function fade() { |