summaryrefslogtreecommitdiff
path: root/js/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-01 07:53:51 +0300
committerAndrew Dolgov <[email protected]>2018-12-01 07:53:51 +0300
commit32d36d439c02a838bc6158f2d9225496629f79c2 (patch)
treef5aec12911f3411b4a63d7c852e4be559929c01f /js/viewfeed.js
parent9e83fcb9f459a0d47d34727babeec64941f3be09 (diff)
in unexpanded mode unpack article only when activated
Diffstat (limited to 'js/viewfeed.js')
-rwxr-xr-xjs/viewfeed.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index ee994c942..3588033d9 100755
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -1114,6 +1114,15 @@ function setActiveArticleId(id) {
const row = $("RROW-" + id);
if (row) {
+ if (row.hasAttribute("data-content")) {
+ console.log("unpacking: " + row.id);
+
+ row.select(".content-inner")[0].innerHTML = row.getAttribute("data-content");
+ row.removeAttribute("data-content");
+
+ PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, row);
+ }
+
if (row.hasClassName("Unread")) {
toggleUnread(id, 0);
@@ -1147,7 +1156,7 @@ function postMouseOut(id) {
}
function unpackVisibleHeadlines() {
- if (!isCdmMode()) return;
+ if (!isCdmMode() || !getInitParam("cdm_expanded")) return;
const rows = $$("#headlines-frame div[id*=RROW][data-content]");
const threshold = $("headlines-frame").scrollTop + $("headlines-frame").offsetHeight + 300;