github.com/blystad/deis@v0.11.0/controller/web/static/js/adjustments.js (about)

     1  $(function(){
     2    var pageHeight;
     3  
     4    function set_columns() {
     5      pageHeight = 0;
     6      $('footer').css('margin-top', '0');
     7      $('.nav-border').css('height', '600');
     8      pageHeight = $(document).height();
     9      // console.log(pageHeight);
    10      $('.nav-border').css('height', pageHeight);
    11  
    12      var margin = pageHeight - 511 - 158;
    13      if (pageHeight < 800){
    14        margin = 270;
    15        $('body').css('height', '930');
    16        $('.nav-border').css('height', '930');
    17      }
    18      $('footer').css('margin-top', margin);
    19      $('footer').css('display', 'block');
    20  
    21      if($(window).width() > 1171){$('.docs-sidebar').css({'position': 'absolute', 'right': '0'})};
    22      if($(window).width() < 1171){$('.docs-sidebar').css('position', 'static');}
    23    }
    24  
    25  //This variable checks if all accordions are closed. Used to ensure styling for Releases & FAQ page.
    26    var allClosed;
    27  
    28    //Close all accordions, besides the menu containing the page that you've clicked on.
    29    $('.toctree-l1').each(function(){
    30      if($(this).children('a').attr('state') == 'open') {
    31        $(this).children('ul').show();
    32        set_columns();
    33        allClosed = false;
    34        return false;
    35      } else {
    36        allClosed = true;
    37      }
    38    });
    39  
    40    if (allClosed == true) {set_columns();}
    41  
    42  
    43    //If menu is closed when clicked, expand it
    44    $('.toctree-l1 > a').click(function() {
    45  
    46      //Make the titles of open accordions dead links
    47      if ($(this).attr('state') == 'open') {return false;}
    48  
    49      //Clicking on a title of a closed accordion
    50      if($(this).attr('state') != 'open' && $(this).siblings().size() > 0) {
    51        $('.toctree-l1 > ul').hide();
    52        $('.toctree-l1 > a').attr('state', '');
    53        $(this).attr('state', 'open');
    54        $(this).next().slideDown(function(){set_columns();});
    55        return false;
    56      }
    57    });
    58  
    59    $(window).resize(set_columns);
    60  });