From 22a7d78d3853015d07620908691c897535dbea8f Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Tue, 9 Jan 2007 23:26:42 +0000 Subject: layout with with for the date and time of recordings entries. --- javascript/treeview.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'javascript') diff --git a/javascript/treeview.js b/javascript/treeview.js index 7adbc5b..3f6fea9 100644 --- a/javascript/treeview.js +++ b/javascript/treeview.js @@ -17,10 +17,24 @@ function findSibling(node, name) return null; } +function findChildNode(node, className) +{ + for (idx = 0; idx < node.childNodes.length; idx++) { + n = node.childNodes.item(idx); + if (n.nodeType == Node.ELEMENT_NODE) { + attr = n.getAttributeNode("class"); + if ((attr != null) && (attr.nodeValue == className)) { + return n; + } + } + } + return null; +} + function findImageNode(node, className) { - for (var idx = 0; idx < node.childNodes.length; idx++) { - var n = node.childNodes.item(idx); + for (idx = 0; idx < node.childNodes.length; idx++) { + n = node.childNodes.item(idx); if ((n.nodeType == Node.ELEMENT_NODE) && (n.nodeName == "IMG")) { attr = n.getAttributeNode("class"); if ((attr != null) && (attr.nodeValue == className)) { @@ -52,15 +66,18 @@ function Toggle(node) if (sibling == null) return; + imgChild = findChildNode(node, "recording_imgs"); if (sibling.style.display == 'none') { - setImages(node, "minus.png", "folder_open.png"); + if (imgChild != null) + setImages(imgChild, "minus.png", "folder_open.png"); sibling.style.display = 'block'; } // Collapse the branch if it IS visible else { - setImages(node, "plus.png", "folder_closed.png"); + if (imgChild != null) + setImages(imgChild, "plus.png", "folder_closed.png"); sibling.style.display = 'none'; } } -- cgit v1.2.3