Commit aa5521f8 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Float guides TOC to right and style like class sidebar.

Also use <ol> instead of <ul>.
parent 85ac2d05
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -63,8 +63,9 @@ module JsDuck
    # Creates table of contents at the top of guide by looking for <h2> elements in HTML.
    def add_toc(guide, html)
      toc = [
        "<div class='toc'>\n",
        "<p><strong>Contents</strong></p>\n",
        "<ul class='toc'>\n",
        "<ol>\n",
      ]
      new_html = []
      i = 0
@@ -77,7 +78,8 @@ module JsDuck
          new_html << line
        end
      end
      toc << "</ul>\n"
      toc << "</ol>\n"
      toc << "</div>\n"
      # Inject TOC at below first heading
      new_html.insert(1, toc)
      new_html.flatten.join
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ Ext.define('Docs.controller.Guides', {
                        this.handleUrlClick(el.href, event);
                    }, this, {
                        preventDefault: true,
                        delegate: 'ul.toc > li > a'
                        delegate: '.toc a'
                    });
                }
            }
+9 −0
Original line number Diff line number Diff line
@@ -87,6 +87,15 @@
#center-container .guide-container {
  padding: 10px;
  font-size: 14px;
  // Table of contents for guides
  // Similar styles to class docs sidebar
  .toc {
    float: right;
    background-color: #f7f7f7;
    border: solid 1px #e8e8e8;
    padding: 10px 20px;
    margin: 0 14px;
    @include border-radius(5px); }
  h1 {
    background: url(../images/doc-m.png) no-repeat -5px -5px;
    padding: 10px 0 10px 55px;