summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-25 14:01:33 +0400
committerAndrew Dolgov <[email protected]>2013-03-25 14:01:33 +0400
commit62b1f587ab6452136f6fe914d2d7545b43ffe5a8 (patch)
tree49472438c0f5393df162b1ca395ce21c69794bbb /js
parent9515f1cc0f923b276f0037e06b4c0e690ab74f7a (diff)
do some tweaks to prevent potential self-reading
Diffstat (limited to 'js')
-rw-r--r--js/viewfeed.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index ece1f1394..485ee3606 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -205,7 +205,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
_infscroll_request_sent = 0;
- headlines_scroll_handler($("headlines-frame"));
+ unpackVisibleHeadlines();
notify("");
@@ -315,7 +315,7 @@ function article_callback2(transport, id) {
var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length
request_counters(unread_in_buffer == 0);
- headlines_scroll_handler($("headlines-frame"));
+ //headlines_scroll_handler($("headlines-frame"));
/* try {
if (!_infscroll_disable &&
@@ -397,7 +397,7 @@ function view(id) {
console.warn(e);
} */
- headlines_scroll_handler($("headlines-frame"));
+ //headlines_scroll_handler($("headlines-frame"));
return;
}
@@ -1174,9 +1174,8 @@ function postMouseOut(id) {
post_under_pointer = false;
}
-function headlines_scroll_handler(e) {
+function unpackVisibleHeadlines() {
try {
- var hsp = $("headlines-spacer");
$$("#headlines-frame > div[id*=RROW]").each(
function(child) {
@@ -1195,6 +1194,17 @@ function headlines_scroll_handler(e) {
);
+ } catch (e) {
+ exception_error("unpackVisibleHeadlines", e);
+ }
+}
+
+function headlines_scroll_handler(e) {
+ try {
+ var hsp = $("headlines-spacer");
+
+ unpackVisibleHeadlines();
+
if (!_infscroll_disable) {
if ((hsp && e.scrollTop + e.offsetHeight >= hsp.offsetTop - hsp.offsetHeight) ||
(e.scrollHeight != 0 &&