From 14bd7905e8558f142c71fe07fca290c2f14b3b36 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Fri, 23 Feb 2018 15:50:39 +0100
Subject: [PATCH] [web] Hide os selector when not required.

---
 web/layouts/docs/single.html | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/web/layouts/docs/single.html b/web/layouts/docs/single.html
index bbe36469919..7c81c252646 100644
--- a/web/layouts/docs/single.html
+++ b/web/layouts/docs/single.html
@@ -24,7 +24,7 @@
   <div class="col-xs-9">
     <h1>{{ .Title }}</h1>
     {{ if eq $subsection "devguide"}}
-    Select OS: <a id="btn-win">Windows</a> <a id="btn-linux">Linux</a> <a id="btn-mac">macOS</a>
+    <div id="os-selector">Select OS: <a id="btn-win">Windows</a> <a id="btn-linux">Linux</a> <a id="btn-mac">macOS</a></div>
     {{ end }}
 
     {{ .Content }}
@@ -71,7 +71,12 @@
     });
 
     $( document ).ready(function() {
-      $("#btn-win").click();
+      if ($(".win").length == 0) {
+        $("#os-selector").hide();
+      }
+      else {
+        $("#btn-win").click();
+      }
     });
   </script>
   {{ end }}
-- 
GitLab