diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-03-02 19:20:42 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-03-03 11:15:10 +0100 |
commit | 13098ccef163c813ae3e196511f44a16a6e73fdd (patch) | |
tree | ded3f17c39523e3ec006274ae0d5e42986b6191c /help3xsl/help.js | |
parent | fc5a433b247927c4b134d7d6028c68837e3e003d (diff) |
tdf#116150 Fix logic for case/caseinline with 'sys'
Change-Id: I5c9cb270fa89ea5281355fc80be2a155b9d9ef9e
Reviewed-on: https://gerrit.libreoffice.org/50650
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
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); + } } } } |