CDM highlight/display tweaks; tweaks for n/p hotkeys (refs #191)

This commit is contained in:
Andrew Dolgov 2008-02-19 16:08:57 +01:00
parent 587bef1021
commit 0df009c3b8
2 changed files with 17 additions and 17 deletions

View File

@ -934,19 +934,19 @@ div.cdmFooter {
color : black; color : black;
padding : 5px; padding : 5px;
color : gray; color : gray;
background-color : white; /* background-color : white; */
border-width : 1px 0px 0px 0px; border-width : 1px 0px 0px 0px;
border-color : #c0c0c0; border-color : #c0c0c0;
border-style : dotted; border-style : dotted;
} }
div.cdmArticleSelected div.cdmFooter { /*div.cdmArticleSelected div.cdmFooter {
background-color : transparent; background-color : transparent;
} }
div.cdmArticleUnreadSelected div.cdmFooter { div.cdmArticleUnreadSelected div.cdmFooter {
background-color : transparent; background-color : transparent;
} }*/
div.cdmFooter span.s0 { div.cdmFooter span.s0 {
border-width : 0px 1px 0px 0px; border-width : 0px 1px 0px 0px;

View File

@ -720,9 +720,11 @@ function moveToPost(mode) {
if (cdmArticleIsActuallyVisible(rows[i]) || if (cdmArticleIsActuallyVisible(rows[i]) ||
cdmArticleIsBelowViewport(rows[i])) { cdmArticleIsBelowViewport(rows[i])) {
cdmScrollToArticleId(rows[i]); if (!cdmArticleIsActuallyVisible(rows[i])) {
setTimeout("toggleUnread(" + rows[i] + ", undefined, true)", 500); cdmScrollToArticleId(rows[i]);
//toggleUnread(rows[i], undefined, true); }
//setTimeout("toggleUnread(" + rows[i] + ", undefined, true)", 500);
toggleUnread(rows[i], undefined, true);
return; return;
} }
@ -734,13 +736,12 @@ function moveToPost(mode) {
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
if (cdmArticleIsActuallyVisible(rows[i]) || if (cdmArticleIsAboveViewport(rows[i]) &&
(cdmArticleIsAboveViewport(rows[i]) && !cdmArticleIsAboveViewport(rows[i+1])) {
!cdmArticleIsAboveViewport(rows[i+1]))) {
cdmScrollToArticleId(rows[i]); cdmScrollToArticleId(rows[i]);
setTimeout("toggleUnread(" + rows[i] + ", undefined, true)", 500); //setTimeout("toggleUnread(" + rows[i] + ", undefined, true)", 500);
//toggleUnread(rows[i], undefined, true); toggleUnread(rows[i], undefined, true);
break; break;
} }
@ -775,17 +776,16 @@ function toggleSelected(id) {
} }
} }
/*function toggleUnread_afh(effect) { function toggleUnread_afh(effect) {
try { try {
var elem = effect.element; var elem = effect.element;
//elem.style.backgroundColor = "transparent"; elem.style.backgroundColor = "";
alert(elem.className);
} catch (e) { } catch (e) {
exception_error(e, "toggleUnread_afh"); exception_error(e, "toggleUnread_afh");
} }
} */ }
function toggleUnread(id, cmode, effect) { function toggleUnread(id, cmode, effect) {
try { try {
@ -810,11 +810,11 @@ function toggleUnread(id, cmode, effect) {
if (row.className.match("Unread")) { if (row.className.match("Unread")) {
row.className = nc; row.className = nc;
/* if (effect) { if (effect) {
new Effect.Highlight(row, {duration: 1, startcolor: "#fff7d5", new Effect.Highlight(row, {duration: 1, startcolor: "#fff7d5",
afterFinish: toggleUnread_afh, afterFinish: toggleUnread_afh,
queue: { position:'end', scope: 'TMRQ-' + id, limit: 1 } } ); queue: { position:'end', scope: 'TMRQ-' + id, limit: 1 } } );
} */ }
} else { } else {
row.className = nc + "Unread"; row.className = nc + "Unread";