Skip to content
Snippets Groups Projects
Commit 7cfd88d5 authored by Goik Martin's avatar Goik Martin
Browse files

Simplify using available standard DOM method.

parent 8fabcc4b
No related branches found
No related tags found
No related merge requests found
......@@ -14,23 +14,21 @@
<xsl:param name="toggleDisplayScript">
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript"> <!-- goiks extension head start -->
function toggleDisplay(inputEl) {
divElem = nextSibling(inputEl);
if (divElem.style.visibility == 'hidden') {
divElem.style.visibility = 'visible';
inputEl.setAttribute('value','-');
} else {
divElem.style.visibility = 'hidden';
inputEl.setAttribute('value','+');
}
}
function nextSibling(n) {
x=n.nextSibling;
while (x.nodeType!=1) {
x=x.nextSibling;
}
return x;
}
"use strict";
function toggleDisplay(inputElement) {
var divElement = inputElement.nextElementSibling;
switch(divElement.style.visibility) {
case 'hidden':
divElement.style.visibility = 'visible';
inputElement.setAttribute('value', '-');
break;
default:
divElement.style.visibility = 'hidden';
inputElement.setAttribute('value', '+');
break;
}
}
</script>
</xsl:param>
......@@ -87,4 +85,4 @@
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment