From cbfda0577635a4e9eaf112173c08ad2b1f04f3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Moreira?= Date: Fri, 15 Dec 2023 21:32:40 +0100 Subject: [PATCH] Add toc handler on interactive readyState --- js/toc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/toc.js b/js/toc.js index 1ed7ea0..fb356d4 100644 --- a/js/toc.js +++ b/js/toc.js @@ -6,7 +6,7 @@ (($, Drupal) => { Drupal.behaviors.clarin_theme_toc = { attach: function attach(context) { - if (context === document && document.readyState !== "loading") { + if (context === document && document.readyState === "interactive") { $(function initToc() { const navSelector = "#toc"; const scopeSelector = "#tocscope";