Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2006-03-03 20:22:53 +0000
committerDejan Gloszic2006-03-03 20:22:53 +0000
commit5df293930a1fab7783d280787a0657f4a5838097 (patch)
tree345a0b8a504b821b42acf7f9980c5318dc31fb51 /org.eclipse.ui.intro/javascript
parenta1334b0681ea79f5b76becdffe1b9ba831681a2c (diff)
downloadeclipse.platform.ua-5df293930a1fab7783d280787a0657f4a5838097.tar.gz
eclipse.platform.ua-5df293930a1fab7783d280787a0657f4a5838097.tar.xz
eclipse.platform.ua-5df293930a1fab7783d280787a0657f4a5838097.zip
*** empty log message ***
Diffstat (limited to 'org.eclipse.ui.intro/javascript')
-rw-r--r--org.eclipse.ui.intro/javascript/common.js29
1 files changed, 27 insertions, 2 deletions
diff --git a/org.eclipse.ui.intro/javascript/common.js b/org.eclipse.ui.intro/javascript/common.js
index 4da3b9c22..ae1017f0f 100644
--- a/org.eclipse.ui.intro/javascript/common.js
+++ b/org.eclipse.ui.intro/javascript/common.js
@@ -1,8 +1,33 @@
-function toggleSection(id) {
+/*
+ * The following function toggles between block and none display
+ * for the element with a given id. It also toggles between
+ * open and closed images for the folding section.
+ * Returns false to stop the browser from following the link.
+ */
+function toggleSection(id, closedId, openId) {
if (document.getElementById) {
var element = document.getElementById(id);
- element.style.display=(element.style.display=="block")?"none":"block";
+ var openImage = document.getElementById(openId);
+ var closedImage = document.getElementById(closedId);
+ if (element.style.display=="block") {
+ // hide the client block
+ element.style.display="none";
+ // switch toggle images
+ if (openImage)
+ openImage.style.display="none";
+ if (closedImage)
+ closedImage.style.display="inline";
+ }
+ else {
+ // turn it on and show
+ element.style.display="block";
+ // switch toggle images
+ if (openImage)
+ openImage.style.display="inline";
+ if (closedImage)
+ closedImage.style.display="none";
+ }
}
return false;
} \ No newline at end of file

Back to the top