From 61530f1b9c8e49324360e9b3042bbbc7aef36e66 Mon Sep 17 00:00:00 2001 From: Jacques Heunis Date: Fri, 29 Jul 2022 13:39:46 +0100 Subject: [PATCH] Fix the category auto-expand on page load --- html/copy/docs.gl.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/html/copy/docs.gl.js b/html/copy/docs.gl.js index e3ca40c2..87b8dfe5 100644 --- a/html/copy/docs.gl.js +++ b/html/copy/docs.gl.js @@ -222,20 +222,12 @@ $(function() { if ($.cookie("pagestyle") == 'dark') $("#style_dark").click(); - - // hack to run after bonsai is initailized - setTimeout(function() { - $(".open_me").each(function() { - // copied from bonsai js to expand w/o animation - var listItem = $(this); - if( !listItem.data('subList') ) - return; - listItem.addClass('expanded').removeClass('collapsed'); - var subList = $(listItem.data('subList')); - subList.css('height', 'auto'); - }); - }, 1); - + + $(".open_me").each(function() { + var category_to_open = $(this); + var category_bonsai = $( "#command_categories" ).data('bonsai'); + category_bonsai.expand(category_to_open); + }); search_fn = function(value) { var version = 'all';