From: Veit Lehmann Date: Sat, 8 Jun 2013 23:02:14 +0000 (+0300) Subject: only update floatingTitle innerHTML if active article changes X-Git-Tag: 1.8~10^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5313ae17e4f270053bd7d55c45baa18fe05fa75b;p=tt-rss.git only update floatingTitle innerHTML if active article changes This will boost scrolling performance pretty much and avoid flickering of floatingTitle --- diff --git a/js/viewfeed.js b/js/viewfeed.js index c20c5a39..b7e321d7 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)