function clickSidebarItemListener()

in fauxton-visual-guide/js/main.js [180:215]


function clickSidebarItemListener () {

  //makes the CSS changes
  $('#redsidebar .section').click(function () {
    clearAll();
    var sectionChosen = $(this).data('nav');

    $('#' + sectionChosen).addClass('shown');
    $('.' + sectionChosen + ' .big-nav-subtitle')
      .css({
        'color': '#750f34',
        'font-weight': 'bold'
      });
    $('.section.' + sectionChosen + ' .large-icon')
      .css('background-image', 'url("imgs/'+ sectionChosen +'-dark.png")');
    $( ".middleBar" ).css('padding-top', '50px');
  });

  //makes the CSS default
  function clearAll () {
    $('#getting-started').removeClass('shown');
    $('#using-fauxton').removeClass('shown');
    $('#answers').removeClass('shown');
    $('.toc .heading, .fauxton-toc .icon-menu a').each(function () {
      $(this).removeClass('selected');
    })

    $('.big-nav-subtitle')
      .css({
        'color': '',
        'font-weight': ''
      });
    $('.getting-started .large-icon, .using-fauxton .large-icon, .answers .large-icon')
      .css('background-image', '');
  }
}