summaryrefslogtreecommitdiff
path: root/js/viewfeed.js
diff options
context:
space:
mode:
authorVeit Lehmann <[email protected]>2013-06-25 06:08:44 +0300
committerVeit Lehmann <[email protected]>2013-06-25 06:08:44 +0300
commitd1754390cc1c45eb469daf0221e235ca1a02d555 (patch)
treeb4e5f382efed6b6d21a5918c9ea0b7df9dc42d57 /js/viewfeed.js
parentd1343b844d96e808620a230ee8f39764acedb581 (diff)
only do article update operations once when scrolling
I discovered that DOM operations and function calls were done several times inside the 100px mirror when scrolling through articles. Especially painful on seamless scrolling systems like Mac OS, where dozens of updates would slow down this part dramatically. This change fixes it.
Diffstat (limited to 'js/viewfeed.js')
-rw-r--r--js/viewfeed.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 9c48fbcdb..1c5811fe7 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -1281,7 +1281,8 @@ function headlines_scroll_handler(e) {
var child = rows[i];
if ($("headlines-frame").scrollTop < child.offsetTop &&
- child.offsetTop - $("headlines-frame").scrollTop < 100) {
+ child.offsetTop - $("headlines-frame").scrollTop < 100 &&
+ child.id.replace("RROW-", "") != _active_article_id) {
if (_active_article_id) {
var row = $("RROW-" + _active_article_id);