guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Ricardo Wurmus
Date: Tue, 13 Feb 2024 11:57:23 -0500 (EST)

branch: wip-js+css
commit 56520dbf053d300a8cc67c32a77bc9d870626206
Author: Ricardo Wurmus <rekado@elephly.net>
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 <othacehe@gnu.org>
+ * Copyright (C) 2024 - Ricardo Wurmus <rekado@elephly.net>
  *
  *
  * 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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]