toggleMark behaviour fixes
This commit is contained in:
parent
ba4363048d
commit
7ba176d2bf
1 changed files with 11 additions and 7 deletions
16
viewfeed.js
16
viewfeed.js
|
@ -87,11 +87,11 @@ function toggleMark(id, toggle) {
|
|||
return;
|
||||
}
|
||||
|
||||
var mark_img = document.getElementById("FMARKPIC-" + id);
|
||||
|
||||
var query = "backend.php?op=rpc&id=" + id + "&subop=mark";
|
||||
|
||||
var mark_img = document.getElementById("FMARKPIC-" + id);
|
||||
var vfeedu = f_document.getElementById("FEEDU--1");
|
||||
var crow = document.getElementById("RROW-" + id);
|
||||
|
||||
// alert(vfeedu);
|
||||
|
||||
|
@ -101,7 +101,9 @@ function toggleMark(id, toggle) {
|
|||
mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', false)');
|
||||
query = query + "&mark=1";
|
||||
|
||||
if (vfeedu) vfeedu.innerHTML = (+vfeedu.innerHTML) + 1;
|
||||
if (vfeedu && crow.className.match("Unread")) {
|
||||
vfeedu.innerHTML = (+vfeedu.innerHTML) + 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
mark_img.src = "images/mark_unset.png";
|
||||
|
@ -109,7 +111,9 @@ function toggleMark(id, toggle) {
|
|||
mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', true)');
|
||||
query = query + "&mark=0";
|
||||
|
||||
if (vfeedu) vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
|
||||
if (vfeedu && crow.className.match("Unread")) {
|
||||
vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -118,9 +122,9 @@ function toggleMark(id, toggle) {
|
|||
|
||||
if (vfeedu && vfeedctr) {
|
||||
if ((+vfeedu.innerHTML) > 0) {
|
||||
vfeedctr.className = "odd";
|
||||
if (!vfeedr.className.match("Unread")) {
|
||||
if (crow.className.match("Unread") && !vfeedr.className.match("Unread")) {
|
||||
vfeedr.className = vfeedr.className + "Unread";
|
||||
vfeedctr.className = "odd";
|
||||
}
|
||||
} else {
|
||||
vfeedctr.className = "invisible";
|
||||
|
|
Loading…
Reference in a new issue