fix(aio): do not display a Toc initially
Previously the `hasToc` was initialised to true, which caused a flash of unwanted "Contents" [sic] even if the page was not going to need a ToC. Closes #16597
This commit is contained in:
parent
799be9c98a
commit
b9ed97c0d9
|
@ -55,6 +55,10 @@ describe('TocComponent', () => {
|
||||||
expect(tocComponent.isEmbedded).toEqual(true);
|
expect(tocComponent.isEmbedded).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not display a ToC initially', () => {
|
||||||
|
expect(tocComponent.hasToc).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it('should not display anything when no TocItems', () => {
|
it('should not display anything when no TocItems', () => {
|
||||||
tocService.tocList.next([]);
|
tocService.tocList.next([]);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { TocItem, TocService } from 'app/shared/toc.service';
|
||||||
export class TocComponent implements OnInit, OnDestroy {
|
export class TocComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
hasSecondary = false;
|
hasSecondary = false;
|
||||||
hasToc = true;
|
hasToc = false;
|
||||||
isClosed = true;
|
isClosed = true;
|
||||||
isEmbedded = false;
|
isEmbedded = false;
|
||||||
private primaryMax = 4;
|
private primaryMax = 4;
|
||||||
|
|
Loading…
Reference in New Issue