in combined non-expanded mode, pack headline rows as they are unfocused to save RAM
This commit is contained in:
parent
afaac95d8d
commit
b3e4f0188e
|
@ -178,11 +178,23 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
if (container.textContent.length == 0)
|
||||
container.innerHTML += " ";
|
||||
|
||||
// in expandable mode, save content for later, so that we can pack unfocused rows back
|
||||
if (App.isCombinedMode() && $("main").hasClassName("expandable"))
|
||||
row.setAttribute("data-content-original", row.getAttribute("data-content"));
|
||||
|
||||
row.removeAttribute("data-content");
|
||||
|
||||
PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, row);
|
||||
}
|
||||
},
|
||||
pack: function(row) {
|
||||
if (row.hasAttribute("data-content-original")) {
|
||||
console.log("packing", row.id);
|
||||
row.setAttribute("data-content", row.getAttribute("data-content-original"));
|
||||
row.removeAttribute("data-content-original");
|
||||
row.innerHTML = " ";
|
||||
}
|
||||
},
|
||||
view: function (id, noexpand) {
|
||||
this.setActive(id);
|
||||
|
||||
|
@ -307,8 +319,9 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
setActive: function (id) {
|
||||
console.log("setActive", id);
|
||||
|
||||
$$("div[id*=RROW][class*=active]").each((e) => {
|
||||
e.removeClassName("active");
|
||||
$$("div[id*=RROW][class*=active]").each((row) => {
|
||||
row.removeClassName("active");
|
||||
Article.pack(row);
|
||||
});
|
||||
|
||||
const row = $("RROW-" + id);
|
||||
|
|
Loading…
Reference in New Issue