mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-18 22:41:09 +02:00
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)
|
if (container.textContent.length == 0)
|
||||||
container.innerHTML += " ";
|
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");
|
row.removeAttribute("data-content");
|
||||||
|
|
||||||
PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, row);
|
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) {
|
view: function (id, noexpand) {
|
||||||
this.setActive(id);
|
this.setActive(id);
|
||||||
|
|
||||||
@ -307,8 +319,9 @@ define(["dojo/_base/declare"], function (declare) {
|
|||||||
setActive: function (id) {
|
setActive: function (id) {
|
||||||
console.log("setActive", id);
|
console.log("setActive", id);
|
||||||
|
|
||||||
$$("div[id*=RROW][class*=active]").each((e) => {
|
$$("div[id*=RROW][class*=active]").each((row) => {
|
||||||
e.removeClassName("active");
|
row.removeClassName("active");
|
||||||
|
Article.pack(row);
|
||||||
});
|
});
|
||||||
|
|
||||||
const row = $("RROW-" + id);
|
const row = $("RROW-" + id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user