]> git.wh0rd.org Git - tt-rss.git/commitdiff
only do article update operations once when scrolling
authorVeit Lehmann <veit.lehmann@googlemail.com>
Tue, 25 Jun 2013 03:08:44 +0000 (06:08 +0300)
committerVeit Lehmann <veit.lehmann@googlemail.com>
Tue, 25 Jun 2013 03:08:44 +0000 (06:08 +0300)
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.

js/viewfeed.js

index 9c48fbcdb9d9bc21bdb17ea04effe9e6e3467841..1c5811fe75a721ccac3ab25828c5e3d73b49decd 100644 (file)
@@ -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);