summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-01-19 11:54:13 +0300
committerAndrew Dolgov <[email protected]>2021-01-19 11:54:13 +0300
commit2933483393b20882b700811844a5bb538bb69d6c (patch)
tree08f5f63c812bbe89e0215c32320975ebabf3cd1b /js
parent41bde84a922db4b0d35241dc84e8de703599654e (diff)
add a hack (Headlines.unpackVisible) to workaround against unpack observer sometimes missing articles
Diffstat (limited to 'js')
-rwxr-xr-xjs/Headlines.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index d0c352aed..3b4498430 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -300,6 +300,16 @@ const Headlines = {
}
}
},
+ unpackVisible: function(container) {
+ const rows = $$("#headlines-frame > div[id*=RROW][data-content].cdm");
+
+ for (let i = 0; i < rows.length; i++) {
+ if (App.Scrollable.isChildVisible(rows[i], container)) {
+ console.log('force unpacking:', rows[i].getAttribute('id'));
+ Article.unpack(rows[i]);
+ }
+ }
+ },
scrollHandler: function (/*event*/) {
try {
if (!Feeds.infscroll_disabled && !Feeds.infscroll_in_progress) {
@@ -320,6 +330,14 @@ const Headlines = {
}
}
+ if (App.isCombinedMode() && App.getInitParam("cdm_expanded")) {
+ const container = $("headlines-frame")
+
+ /* don't do anything until there was some scrolling */
+ if (container.scrollTop > 0)
+ Headlines.unpackVisible(container);
+ }
+
if (App.getInitParam("cdm_auto_catchup")) {
const rows = $$("#headlines-frame > div[id*=RROW][class*=Unread]");