Skip to content

Commit

Permalink
fix(aio): do not display a Toc initially
Browse files Browse the repository at this point in the history
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 angular#16597
  • Loading branch information
petebacondarwin authored and juleskremer committed Aug 24, 2017
1 parent a4562b1 commit c11dca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions aio/src/app/embedded/toc/toc.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion aio/src/app/embedded/toc/toc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c11dca1

Please sign in to comment.