feat(aio): implement gkalpak review suggestions
This commit is contained in:
parent
4be1966a21
commit
f1f04fa782
|
@ -1,6 +1,6 @@
|
|||
<div *ngIf="hasToc" [class.closed]="isClosed">
|
||||
<div *ngIf="!hasSecondary"class="toc-heading">Contents</div>
|
||||
<div *ngIf="hasSecondary" class="toc-heading secondary"
|
||||
<div *ngIf="!hasSecondary" class="toc-heading">Contents</div>
|
||||
<div *ngIf="hasSecondary" class="toc-heading secondary"
|
||||
(click)="toggle()"
|
||||
title="Expand/collapse contents"
|
||||
aria-label="Expand/collapse contents">
|
||||
|
|
|
@ -17,9 +17,9 @@ export class TocComponent implements OnInit {
|
|||
tocList: TocItem[];
|
||||
|
||||
constructor(
|
||||
private elementRef: ElementRef,
|
||||
elementRef: ElementRef,
|
||||
private tocService: TocService) {
|
||||
const hostElement = this.elementRef.nativeElement;
|
||||
const hostElement = elementRef.nativeElement;
|
||||
this.isEmbedded = hostElement.className.indexOf('embedded') !== -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ export class DocViewerComponent implements DoCheck, OnDestroy {
|
|||
let title = '';
|
||||
const titleEl = this.hostElement.querySelector('h1');
|
||||
// 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) {
|
||||
title = titleEl.innerText.trim();
|
||||
if (!/(no-toc|notoc)/i.test(titleEl.className)) {
|
||||
|
|
|
@ -94,10 +94,3 @@ aio-toc > div {
|
|||
aio-toc > div.closed li.secondary {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
aio-toc.embedded:not(:empty) {
|
||||
display: block;
|
||||
margin: 20px 0 24px;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue