diff options
Diffstat (limited to 'help3xsl/help.js')
-rw-r--r-- | help3xsl/help.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js index 9329f2d0fb..8386055269 100644 --- a/help3xsl/help.js +++ b/help3xsl/help.js @@ -19,16 +19,31 @@ function setModule(module) { } } } -// Used to set system in caseinline=SYSTEM +// Used to set system in case, caseinline=SYSTEM function setSystem(system) { - var itemspan = document.getElementsByTagName("span"); + var hasSystem; + // if no System in URL, get browser system if (system === null) { - system = "WIN"; + system = getSystem(); } + // on loading page, DEFAULTSYS visible, sys is hidden + // when hasSystem, show sys, hide DEFAULTSYS + var itemspan = document.getElementsByTagName("span"); var n = itemspan.length; + //Show when system is found in page + hasSystem = false; for (var i = 0; i < n; i++) { if (itemspan[i].getAttribute("value") == system) { itemspan[i].removeAttribute("hidden"); + hasSystem = true; + } + } + //it hasSystem, then hide all DEFAULTSYS + if (hasSystem){ + for (var i = 0; i < n; i++) { + if (itemspan[i].getAttribute("value") == "DEFAULTSYS") { + itemspan[i].setAttribute("hidden",true); + } } } } |