branch: wip-js+css
commit 56520dbf053d300a8cc67c32a77bc9d870626206
Author: Ricardo Wurmus <[email protected]>
AuthorDate: Mon Feb 12 12:29:01 2024 +0100
cuirass.js: Replace $(document).ready.
* src/static/js/cuirass.js (ready): New procedure; use it instead of
jQuery's
$(document).ready.
---
src/static/js/cuirass.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/static/js/cuirass.js b/src/static/js/cuirass.js
index f20a809..f5cdd1b 100644
--- a/src/static/js/cuirass.js
+++ b/src/static/js/cuirass.js
@@ -7,6 +7,7 @@
* JavaScript code in this page.
*
* Copyright (C) 2021 - Mathieu Othacehe <[email protected]>
+ * Copyright (C) 2024 - Ricardo Wurmus <[email protected]>
*
*
* The JavaScript code in this page is free software: you can
@@ -27,7 +28,13 @@
* for the JavaScript code in this page.
*
*/
-$(document).ready(function() {
+
+var ready = (callback) => {
+ if (document.readyState != "loading") callback();
+ else document.addEventListener("DOMContentLoaded", callback);
+}
+
+ready(() => {
/* Specifications page. */
var default_opts = {
paging: false,