]> git.wh0rd.org - tt-rss.git/commitdiff
only update floatingTitle innerHTML if active article changes
authorVeit Lehmann <veit.lehmann@googlemail.com>
Sat, 8 Jun 2013 23:02:14 +0000 (02:02 +0300)
committerVeit Lehmann <veit.lehmann@googlemail.com>
Sat, 8 Jun 2013 23:02:14 +0000 (02:02 +0300)
This will boost scrolling performance pretty much and avoid flickering of floatingTitle

js/viewfeed.js

index c20c5a39b30aa6a9c84638fd565d2ebd409d7836..b7e321d735497e6b7b01ec8d3698a2f877536826 100644 (file)
@@ -2208,9 +2208,10 @@ function updateFloatingTitle() {
 
                                var header = child.getElementsByClassName("cdmHeader")[0];
 
-                               $("floatingTitle").setAttribute("rowid", child.id);
-                               $("floatingTitle").innerHTML =
-                                       header.innerHTML;
+                               if (child.id != $("floatingTitle").getAttribute("rowid")) {
+                                       $("floatingTitle").setAttribute("rowid", child.id);
+                                       $("floatingTitle").innerHTML = header.innerHTML;
+                               }
 
                                if (child.offsetTop < hf.scrollTop - header.offsetHeight - 100 &&
                                                child.offsetTop + child.offsetHeight - hf.scrollTop > 100)