diff --git a/doc/doxygen/src/js/riot-doxy.js b/doc/doxygen/src/js/riot-doxy.js index 4fb4ff16a8aa..225dad9c44bf 100644 --- a/doc/doxygen/src/js/riot-doxy.js +++ b/doc/doxygen/src/js/riot-doxy.js @@ -46,14 +46,10 @@ function resize_content(sidenav) function resize_handler() { - if ($(window).width() == window_before) {return;} - var sidenav = $("#side-nav"); - if ($(window).width() < 750) { + const threshold = 750; + if ($(window).width() < threshold) { var toc = $(".toc"); - if (window_before >= 750) { - original_sidenav_width = sidenav.width(); - } sidenav.width("0px"); sidenav.css("padding-right", "0px"); sidenav.children(".ui-resizable-e").width("0px"); @@ -63,7 +59,9 @@ function resize_handler() } else { var toc = $(".toc-sm"); - sidenav.width(parseInt(original_sidenav_width)+"px"); + if (window_before < threshold) { + sidenav.width(parseInt(default_sidenav_width)+"px"); + } sidenav.css("padding-right", original_padding); sidenav.children(".ui-resizable-e").width(original_padding); sidenav.show(); @@ -77,8 +75,8 @@ function resize_handler() $(document).ready(function() { var sidenav = $("#side-nav"); original_padding = sidenav.css("padding-right") - window_before = $(window).width() - original_sidenav_width = (window_before >= 740) ? sidenav.width() : 275; + window_before = 0 + default_sidenav_width = 300; resize_handler(); }); $(window).resize(resize_handler);