try {
if (infscroll_req == false) {
$("headlines-frame").scrollTop = 0;
+
+ Element.hide("floatingTitle");
+ $("floatingTitle").setAttribute("rowid", 0);
+ $("floatingTitle").innerHTML = "";
}
} catch (e) { };
unpackVisibleHeadlines();
// set topmost child in the buffer as active
- if (getInitParam("cdm_auto_catchup") == 1) {
+ if (getInitParam("cdm_auto_catchup") == 1 &&
+ getSelectedArticleIds2().length <= 1 &&
+ (!isCdmMode() || getInitParam("cdm_expanded"))) {
var rows = $$("#headlines-frame > div[id*=RROW]");
for (var i = 0; i < rows.length; i++) {
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);
new Effect.Fade(elem, {duration : 0.5});
+ // Remove the content, too
+ var elem_content = $("CICD-" + id);
+ if (elem_content) {
+ Element.remove(elem_content);
+ }
+
if (id == getActiveArticleId()) {
setActiveArticleId(0);
}
ids[i] != getActiveArticleId()) {
new Effect.Fade(elem, {duration : 0.5});
sel.push(ids[i]);
+
+ // Remove the content, too
+ var elem_content = $("CICD-" + ids[i]);
+ if (elem_content) {
+ Element.remove(elem_content);
+ }
} else {
tmp.push(ids[i]);
}
!elem.hasClassName("Selected")) {
new Effect.Fade(elem, {duration : 0.5});
+
+ // Remove the content, too
+ var elem_content = $("CICD-" + ids[i]);
+ if (elem_content) {
+ Element.remove(elem_content);
+ }
} else {
tmp.push(ids[i]);
}
}
} catch (e) {
- exception_error("dismissSelectedArticles", e);
+ exception_error("dismissReadArticles", e);
}
}
}
}
+function scrollToRowId(id) {
+ try {
+ var row = $(id);
+
+ if (row)
+ $("headlines-frame").scrollTop = row.offsetTop;
+
+ } catch (e) {
+ exception_error("scrollToRowId", e);
+ }
+}
+
function updateFloatingTitle() {
try {
var hf = $("headlines-frame");
+ var child = $("RROW-" + _active_article_id);
- var elems = $$("#headlines-frame > div[id*=RROW]");
+ var elems;
+
+ if (getInitParam("cdm_auto_catchup"))
+ elems = [$$("RROW-" + _active_article_id)];
+ else
+ elems = $$("#headlines-frame > div[id*=RROW]");
for (var i = 0; i < elems.length; i++) {
+
var child = elems[i];
- if (child.offsetTop + child.offsetHeight > hf.scrollTop) {
+ if (child && child.offsetTop + child.offsetHeight > hf.scrollTop) {
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;
+ $("floatingTitle").firstChild.innerHTML = "<img class='anchor markedPic' src='images/page_white_go.png' onclick=\"scrollToRowId('"+child.id+"')\">" + $("floatingTitle").firstChild.innerHTML;
- if (child.offsetTop < hf.scrollTop - header.offsetHeight - 100 &&
- child.offsetTop + child.offsetHeight - hf.scrollTop > 100)
+ PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
+ }
+
+ if (child.offsetTop < hf.scrollTop - header.offsetHeight)
Element.show("floatingTitle");
else
Element.hide("floatingTitle");
- break;
+ return;
+
}
}
+
} catch (e) {
exception_error("updateFloatingTitle", e);
}