feat(aio): implement gkalpak review suggestions

This commit is contained in:
Ward Bell 2017-04-27 15:33:50 -07:00 committed by Pete Bacon Darwin
parent 4be1966a21
commit f1f04fa782
4 changed files with 5 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<div *ngIf="hasToc" [class.closed]="isClosed"> <div *ngIf="hasToc" [class.closed]="isClosed">
<div *ngIf="!hasSecondary"class="toc-heading">Contents</div> <div *ngIf="!hasSecondary" class="toc-heading">Contents</div>
<div *ngIf="hasSecondary" class="toc-heading secondary" <div *ngIf="hasSecondary" class="toc-heading secondary"
(click)="toggle()" (click)="toggle()"
title="Expand/collapse contents" title="Expand/collapse contents"

View File

@ -17,9 +17,9 @@ export class TocComponent implements OnInit {
tocList: TocItem[]; tocList: TocItem[];
constructor( constructor(
private elementRef: ElementRef, elementRef: ElementRef,
private tocService: TocService) { private tocService: TocService) {
const hostElement = this.elementRef.nativeElement; const hostElement = elementRef.nativeElement;
this.isEmbedded = hostElement.className.indexOf('embedded') !== -1; this.isEmbedded = hostElement.className.indexOf('embedded') !== -1;
} }

View File

@ -97,7 +97,7 @@ export class DocViewerComponent implements DoCheck, OnDestroy {
let title = ''; let title = '';
const titleEl = this.hostElement.querySelector('h1'); const titleEl = this.hostElement.querySelector('h1');
// Only create TOC for docs with an <h1> title // Only create TOC for docs with an <h1> title
// If you don't want a TOC, don't have an <h1> // If you don't want a TOC, add "no-toc" class to <h1>
if (titleEl) { if (titleEl) {
title = titleEl.innerText.trim(); title = titleEl.innerText.trim();
if (!/(no-toc|notoc)/i.test(titleEl.className)) { if (!/(no-toc|notoc)/i.test(titleEl.className)) {

View File

@ -94,10 +94,3 @@ aio-toc > div {
aio-toc > div.closed li.secondary { aio-toc > div.closed li.secondary {
display: none; display: none;
} }
@media screen and (max-width: 1200px) {
aio-toc.embedded:not(:empty) {
display: block;
margin: 20px 0 24px;
}
}