From e4dc6b84b1abab55971bda4802bf875b6a38aed9 Mon Sep 17 00:00:00 2001
From: XhmikosR <xhmikosr@gmail.com>
Date: Wed, 17 Jul 2019 11:29:30 +0300
Subject: [PATCH] Move inline JS to application.js.

---
 site/content/docs/4.3/forms/checks.md             |  7 -------
 site/static/docs/4.3/assets/js/src/application.js | 10 ++++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/site/content/docs/4.3/forms/checks.md b/site/content/docs/4.3/forms/checks.md
index 5c1110858a..34369b80f4 100644
--- a/site/content/docs/4.3/forms/checks.md
+++ b/site/content/docs/4.3/forms/checks.md
@@ -14,13 +14,6 @@ Structurally, our `<input>`s and `<label>`s are sibling elements as opposed to a
 
 Our checks use custom Bootstrap icons to indicate checked or indeterminate states.
 
-<script>
-document.addEventListener("DOMContentLoaded", function() {
-  var checkbox = document.getElementById("flexCheckIndeterminate");
-  checkbox.indeterminate = true;
-});
-</script>
-
 ## Checks
 
 {{< example >}}
diff --git a/site/static/docs/4.3/assets/js/src/application.js b/site/static/docs/4.3/assets/js/src/application.js
index 60680aa721..9f7abe8b5c 100644
--- a/site/static/docs/4.3/assets/js/src/application.js
+++ b/site/static/docs/4.3/assets/js/src/application.js
@@ -19,6 +19,16 @@
     return [].slice.call(list)
   }
 
+  (function () {
+    var checkbox = document.getElementById('flexCheckIndeterminate')
+
+    if (!checkbox) {
+      return
+    }
+
+    checkbox.indeterminate = true
+  })()
+
   makeArray(document.querySelectorAll('.js-sidenav-group'))
     .forEach(function (sidenavGroup) {
       var groupHasLinks = Boolean(sidenavGroup.querySelector('li'))
-- 
GitLab