in unexpanded mode unpack article only when activated

This commit is contained in:
Andrew Dolgov 2018-12-01 07:53:51 +03:00
parent 9e83fcb9f4
commit 32d36d439c
1 changed files with 10 additions and 1 deletions

View File

@ -1114,6 +1114,15 @@ function setActiveArticleId(id) {
const row = $("RROW-" + id); const row = $("RROW-" + id);
if (row) { 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")) { if (row.hasClassName("Unread")) {
toggleUnread(id, 0); toggleUnread(id, 0);
@ -1147,7 +1156,7 @@ function postMouseOut(id) {
} }
function unpackVisibleHeadlines() { function unpackVisibleHeadlines() {
if (!isCdmMode()) return; if (!isCdmMode() || !getInitParam("cdm_expanded")) return;
const rows = $$("#headlines-frame div[id*=RROW][data-content]"); const rows = $$("#headlines-frame div[id*=RROW][data-content]");
const threshold = $("headlines-frame").scrollTop + $("headlines-frame").offsetHeight + 300; const threshold = $("headlines-frame").scrollTop + $("headlines-frame").offsetHeight + 300;