make floating title less cpu intensive

master
Andrew Dolgov 12 years ago
parent b627f574f8
commit d1343b844d

@ -2216,13 +2216,9 @@ function openSelectedAttachment(elem) {
function updateFloatingTitle() { function updateFloatingTitle() {
try { try {
var hf = $("headlines-frame"); var hf = $("headlines-frame");
var child = $("RROW-" + _active_article_id);
var elems = $$("#headlines-frame > div[id*=RROW]"); if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
for (var i = 0; i < elems.length; i++) {
var child = elems[i];
if (child.offsetTop + child.offsetHeight > hf.scrollTop) {
var header = child.getElementsByClassName("cdmHeader")[0]; var header = child.getElementsByClassName("cdmHeader")[0];
@ -2236,10 +2232,8 @@ function updateFloatingTitle() {
Element.show("floatingTitle"); Element.show("floatingTitle");
else else
Element.hide("floatingTitle"); Element.hide("floatingTitle");
break;
}
} }
} catch (e) { } catch (e) {
exception_error("updateFloatingTitle", e); exception_error("updateFloatingTitle", e);
} }

Loading…
Cancel
Save