include ./mixins/sidebar.jade
.row.docs-row(ng-show="README" ng-controller="README")
  .hidden-xs.col-sm-3.sidebar-col(ng-if="showSections")
    +sidebar(false)
  .col-xs-12.readme-contents.docs-col(ng-class="{'col-sm-9': showSections}")
    .text-center
      img.logo(ng-show="spec.info['x-logo']"
               ng-src="{{ spec.info['x-logo'].url || spec.info['x-logo'] }}"
               style="padding: 5px; background-color: {{ spec.info['x-logo'].backgroundColor || '#fff' }}")
    div(ng-if="showSections" ng-repeat="section in README")
      h1.scroll-target(ng-bind="section.title" id="ScrollTarget{{$index}}")
      .markdown-container(marked="section.contents")
    .markdown-container(ng-if="!showSections" marked="README")

script.
  $('.docs-col').last().scroll(function() {
    var scope = $('.docs-row .sidebar').scope();
    scope.onScroll();
    scope.$apply();
  })

