Browse Source

Fix issue with Algolia's docsearch object being missing in pages with tabs

Fixes https://github.com/godotengine/godot-docs/issues/7469
panreyes 2 năm trước cách đây
mục cha
commit
023122177b
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      _static/js/algolia.js

+ 5 - 0
_static/js/algolia.js

@@ -3,6 +3,11 @@
 
     var doc_version = document.querySelector('meta[name="doc_version"]').getAttribute('content');
 
+    // If the current page uses tabs, we will need this small patch
+    if (typeof(docsearch) == 'undefined') {
+        docsearch = exports['docsearch'];
+    }
+
     // Initialize the Algolia search widget
     docsearch({
         apiKey: 'c39cb614363a2a156811478bc2d0573b',