summaryrefslogtreecommitdiff
path: root/help3xsl/help.js
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-03-02 19:20:42 -0300
committerJan Holesovsky <kendy@collabora.com>2018-08-07 17:52:30 +0200
commitee281114f9914b8ae77852eb1a57cbe9f62cace6 (patch)
tree4402939cb077ed97a8cdda63d1dd673be4ad69b1 /help3xsl/help.js
parent4f5b0546d4fdfae9f7107cc8f20c5a01da99c7b8 (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.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js
index 2425e1ecb0..f33117bf94 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -20,16 +20,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);
+ }
}
}
}