possible fix for hideOrShowFeedCategory IE7 bug

This commit is contained in:
Andrew Dolgov 2006-08-12 18:14:33 +01:00
parent 4407ebbe41
commit b31c23117a
1 changed files with 22 additions and 15 deletions

View File

@ -775,26 +775,33 @@ function hideOrShowFeedsCategory(doc, node, hide, cat_node) {
for (i = 0; i < node.childNodes.length; i++) { for (i = 0; i < node.childNodes.length; i++) {
if (node.childNodes[i].nodeName != "LI") { continue; } if (node.childNodes[i].nodeName != "LI") { continue; }
var has_unread = (node.childNodes[i].className != "feed"); if (node.childNodes[i].style != undefined) {
// debug(node.childNodes[i].id + " --> " + has_unread); var has_unread = (node.childNodes[i].className != "feed");
if (hide && !has_unread) { // debug(node.childNodes[i].id + " --> " + has_unread);
node.childNodes[i].style.display = "none";
if (hide && !has_unread) {
node.childNodes[i].style.display = "none";
}
if (!hide) {
node.childNodes[i].style.display = "list-item";
}
if (has_unread) {
cat_unread++;
}
} }
if (!hide) {
node.childNodes[i].style.display = "list-item";
}
if (has_unread) {
cat_unread++;
}
} }
} }
if (cat_unread == 0) { if (cat_unread == 0) {
if (cat_node.style == undefined) {
debug("ERROR: supplied cat_node " + cat_node +
" has no styles. WTF?");
return;
}
if (hide) { if (hide) {
cat_node.style.display = "none"; cat_node.style.display = "none";
} else { } else {