From 32d36d439c02a838bc6158f2d9225496629f79c2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 1 Dec 2018 07:53:51 +0300 Subject: [PATCH] in unexpanded mode unpack article only when activated --- js/viewfeed.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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;