From 5313ae17e4f270053bd7d55c45baa18fe05fa75b Mon Sep 17 00:00:00 2001 From: Veit Lehmann Date: Sun, 9 Jun 2013 02:02:14 +0300 Subject: [PATCH] only update floatingTitle innerHTML if active article changes This will boost scrolling performance pretty much and avoid flickering of floatingTitle --- js/viewfeed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index c20c5a39b..b7e321d73 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -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)