From f6bda0aad49de3b07ca97c7d151dcd18ffe1ead3 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Thu, 17 Mar 2022 20:50:59 +0100
Subject: [PATCH] Move generic part to bundle

---
 modules/core/www/assets/js/loginuserpass.js | 16 ----------------
 src/js/bundle.js                            | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/modules/core/www/assets/js/loginuserpass.js b/modules/core/www/assets/js/loginuserpass.js
index 16ec5dcd2..6685cd43a 100644
--- a/modules/core/www/assets/js/loginuserpass.js
+++ b/modules/core/www/assets/js/loginuserpass.js
@@ -1,19 +1,3 @@
-window.readyHandlers = [];
-window.ready = function ready(handler) {
-  window.readyHandlers.push(handler);
-  handleState();
-};
-
-window.handleState = function handleState () {
-  if (document.readyState === 'interactive' || document.readyState === "complete") {
-    while(window.readyHandlers.length > 0) {
-      (window.readyHandlers.shift())();
-    }
-  }
-};
-
-document.onreadystatechange = window.handleState;
-
 ready(function () {
   // your code here
   var button = document.getElementById("submit_button");
diff --git a/src/js/bundle.js b/src/js/bundle.js
index 41cc0084e..608ce4d26 100644
--- a/src/js/bundle.js
+++ b/src/js/bundle.js
@@ -6,6 +6,22 @@ import xml from "highlight.js/lib/languages/xml";
 import php from "highlight.js/lib/languages/php";
 import json from "highlight.js/lib/languages/json";
 
+window.readyHandlers = [];
+window.ready = function ready(handler) {
+  window.readyHandlers.push(handler);
+  handleState();
+};
+
+window.handleState = function handleState () {
+  if (document.readyState === 'interactive' || document.readyState === "complete") {
+    while(window.readyHandlers.length > 0) {
+      (window.readyHandlers.shift())();
+    }
+  }
+};
+
+document.onreadystatechange = window.handleState;
+
 $(document).ready(function () {
     $('#language-selector').on('change', function () {
         $("#language-form").submit();
-- 
GitLab