summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-01-22 20:57:16 +0300
committerAndrew Dolgov <[email protected]>2017-01-22 20:57:16 +0300
commitad326dbf78f824c3b26558a05893cec80e07f898 (patch)
tree7a1a3f3cd566bde5b12533f2800ccc4f81e0051e /js
parent70c5b2bfcc766c82c697e431371be308ebad11dc (diff)
unpackVisibleHeadlines: do not iterate over all RROWs all the time
Diffstat (limited to 'js')
-rwxr-xr-xjs/viewfeed.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index ac9d42255..1f597e226 100755
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -1238,21 +1238,21 @@ function unpackVisibleHeadlines() {
try {
if (!isCdmMode() || !getInitParam("cdm_expanded")) return;
- $$("#headlines-frame > div[id*=RROW]").each(
+ $$("#headlines-frame span.cencw[id]").each(
function(child) {
- if (child.offsetTop <= $("headlines-frame").scrollTop +
+ var row = $("RROW-" + child.id.replace("CENCW-", ""));
+
+ if (row && row.offsetTop <= $("headlines-frame").scrollTop +
$("headlines-frame").offsetHeight) {
- var cencw = $("CENCW-" + child.getAttribute("data-article-id"));
+ //console.log("unpacking: " + child.id);
- if (cencw) {
- cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
- cencw.setAttribute('id', '');
+ child.innerHTML = htmlspecialchars_decode(child.innerHTML);
+ child.removeAttribute('id');
- PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, child);
+ PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, row);
- Element.show(cencw);
- }
+ Element.show(child);
}
}
);