use a smooth animation to fade in the navigation

This avoids the flash of unstyled/unprocessed content
This commit is contained in:
Andreas Gohr 2019-03-21 11:35:34 +01:00
commit 4ac10cf3be
2 changed files with 8 additions and 0 deletions

View file

@ -135,6 +135,11 @@ class Template {
} else {
// main navigation, loaded from standard sidebar, fixed up by javascript
$nav = '<nav class="nav-main">';
// immeadiately hide the navigation (if javascript available)
// it will be restyled and made visible again by our script later
$nav .= '<script type="application/javascript">
document.getElementsByClassName("nav-main")[0].style.visibility = "hidden";
</script>';
$nav .= tpl_include_page($conf['sidebar'], false, true);
$nav .= '</nav>';
}

View file

@ -144,6 +144,9 @@ jQuery(function () {
}
});
// fade in the navigation (was hidden until now
$main.css({opacity: 0, visibility: "visible"}).animate({opacity: 1}, 200);
},
/**