We are using the documentation Theme but many users complain about the bad user experience and behaviour of the documentation sidebar.
The main problem: When the list of pages in a space grows and there is a page (with subpages) you have to scroll down for in the sidebar, you do this once.
But evertime you once entered such a page, the full page reloads, you have to scroll down the sidebar again to select a sub-page / follow-up-page in the documentation tree.
So I thought I could manage this with a little bit jQuery... but I can't ;/
The problem is, that unfortunately neither AJS.toInit nor AJS.$(document).ready are fired/triggered when the page reload is really done but some (milli)seconds before.
<!-- SCROLL SIDEBAR TO SELECTED SIDE -->
<script type="text/javascript">
AJS.$(document).ready(function() {
if (AJS.$("SPAN.plugin_pagetree_children_span[style*=font-weight]").length == 1) {
AJS.$("#splitter-sidebar")
.scrollTop(
AJS.$("SPAN.plugin_pagetree_children_span[style*=font-weight]").offset().top
-155
);
}
});
// onother test:
AJS.toInit(function() { console.log("READY LOADING PAGE Test toInit()") });
</script>
How can I handle this?! Is there another trigger I can bind this "post-page loaded" event to?
Also discussed in https://support.atlassian.com/browse/CSP-91915