// This script should be included at the END of the document. // For the fastest loading it does not inlude $(document).ready() // This Document contains a few helper functions for the documentation to display the current version, // collapse and expand the menu etc. // Function to make the sticky header possible function shiftWindow() { scrollBy(0, -70); console.log("window shifted") } window.addEventListener("hashchange", shiftWindow); function loadShift() { if (window.location.hash) { console.log("window has hash"); shiftWindow(); } } $(window).load(function() { loadShift(); }); $(function(){ // sidebar accordian-ing // don't apply on last object (it should be the FAQ) or the first (it should be introduction) // define an array to which all opened items should be added var openmenus = []; var elements = $('.toctree-l2'); // for (var i = 0; i < elements.length; i += 1) { var current = $(elements[i]); current.children('ul').hide();} // set initial collapsed state var elements = $('.toctree-l1'); for (var i = 0; i < elements.length; i += 1) { var current = $(elements[i]); if (current.hasClass('current')) { current.addClass('open'); currentlink = current.children('a')[0].href; openmenus.push(currentlink); // do nothing } else { // collapse children current.children('ul').hide(); } } if (doc_version == "") { $('.version-flyer ul').html('