Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
hide TOC unless there is > 1 topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Apr 14, 2014
1 parent f757bc9 commit e4d61ae
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 5 additions & 1 deletion core-doc-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}

core-doc-toc {
display: none;
width: 332px;
overflow-x: hidden;
}
Expand All @@ -37,7 +38,7 @@
</template>

<core-layout core-fit>
<core-doc-toc data="{{classes}}" selected="{{selected}}"></core-doc-toc>
<core-doc-toc id="toc" data="{{classes}}" selected="{{selected}}"></core-doc-toc>
<core-doc-page core-flex data="{{data}}"></core-doc-page>
</core-layout>

Expand Down Expand Up @@ -92,6 +93,9 @@
if (!this.data && !this.route && this.classes.length) {
this.data = this.classes[0];
}
if (this.classes.length > 1) {
this.$.toc.style.display = 'block';
}
this.validateRoute();
}

Expand Down
3 changes: 2 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<body unresolved>

<core-doc-viewer sources='[
"../core-ajax/core-ajax.html"
"../core-ajax/core-ajax.html",
"../core-ajax/core-xhr.html"
]'></core-doc-viewer>

</body>
Expand Down
15 changes: 10 additions & 5 deletions elements/core-doc-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
display: block;
}

#panel {
height: 100%;
}

.main {
padding: 0 72px;
max-width: 832px;
margin: 0 auto;
}

markedjs-element {
display: block;
}
Expand Down Expand Up @@ -62,11 +72,6 @@ pre code {
border: none;
}

.main {
padding: 0 72px;
max-width: 832px;
}

/**/

.details-name {
Expand Down
2 changes: 1 addition & 1 deletion elements/core-doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<link rel="stylesheet" href="../../highlightjs/styles/default.css">
<link rel="stylesheet" href="core-doc-page.css">

<core-header-panel style="height: 100%;" mode="waterfall">
<core-header-panel id="panel" mode="waterfall">

<!--<core-toolbar>
<span style="margin: 0 72px;">{{data.name}}</span>
Expand Down

0 comments on commit e4d61ae

Please sign in to comment.