[gi-docgen/ebassi/devhelp: 2/2] template: Detect DevHelp




commit 4ce8eab79e38db7c1c283e752bde4a3a14d404b2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Apr 7 13:25:47 2021 +0100

    template: Detect DevHelp
    
    We can change the exposed UI depending on whether the documentation is
    browsed through DevHelp, and avoid duplication of existing
    functionality.

 gidocgen/templates/basic/main.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gidocgen/templates/basic/main.js b/gidocgen/templates/basic/main.js
index 46f03fb..aa428d2 100644
--- a/gidocgen/templates/basic/main.js
+++ b/gidocgen/templates/basic/main.js
@@ -553,6 +553,13 @@ window.addEventListener("load", function() {
         });
     }
 
+    // Hide the side bar when running under DevHelp; DevHelp has its own
+    // side bar and search function, so there's no reason to duplicate
+    // its functionality
+    if (navigator.userAgent.indexOf("DevHelp") !== -1) {
+        sidebar.addClass("hidden");
+    }
+
     if (window.buildIndex) {
         window.buildIndex('index.json');
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]