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);
|
||||
});
|
||||
|
||||
it('should not display a ToC initially', () => {
|
||||
expect(tocComponent.hasToc).toBe(false);
|
||||
});
|
||||
|
||||
it('should not display anything when no TocItems', () => {
|
||||
tocService.tocList.next([]);
|
||||
fixture.detectChanges();
|
||||
|
|
|
@ -12,7 +12,7 @@ import { TocItem, TocService } from 'app/shared/toc.service';
|
|||
export class TocComponent implements OnInit, OnDestroy {
|
||||
|
||||
hasSecondary = false;
|
||||
hasToc = true;
|
||||
hasToc = false;
|
||||
isClosed = true;
|
||||
isEmbedded = false;
|
||||
private primaryMax = 4;
|
||||
|
|
Loading…
Reference in New Issue