Skip to content

Commit

Permalink
Merge pull request #20631 from maribu/doc/doxygen/fix-sidenav
Browse files Browse the repository at this point in the history
doc/doxygen: fix sidenav handling
  • Loading branch information
dylad authored Apr 27, 2024
2 parents 420ee3f + 166d3aa commit c2bd865
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions doc/doxygen/src/js/riot-doxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
Expand All @@ -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);

0 comments on commit c2bd865

Please sign in to comment.