From 6e05ae02a2bcc054043f1e3380dd326a08bc65f6 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 16 May 2018 20:24:24 +0300 Subject: [PATCH] fix(aio): show embedded ToC (#23944) On narrow screens (where there is not enough room on the right to show the floating ToC), an embedded ToC is shown (via an `` element in the document). Since ToC was not a custom element, the component was not instantiated for the embedded element. This commit fixes it by making `aio-toc` a custom element and loading it manually for the floating ToC (if necessary). PR Close #23944 --- aio/scripts/_payload-limits.json | 4 +- aio/src/app/app.component.html | 2 +- aio/src/app/app.component.spec.ts | 37 ++++++++++++------- aio/src/app/app.module.ts | 3 -- .../app/custom-elements/element-registry.ts | 4 ++ .../toc/toc.component.html | 0 .../toc/toc.component.spec.ts | 2 +- .../toc/toc.component.ts | 0 aio/src/app/custom-elements/toc/toc.module.ts | 14 +++++++ 9 files changed, 45 insertions(+), 21 deletions(-) rename aio/src/app/{layout => custom-elements}/toc/toc.component.html (100%) rename aio/src/app/{layout => custom-elements}/toc/toc.component.spec.ts (100%) rename aio/src/app/{layout => custom-elements}/toc/toc.component.ts (100%) create mode 100644 aio/src/app/custom-elements/toc/toc.module.ts diff --git a/aio/scripts/_payload-limits.json b/aio/scripts/_payload-limits.json index a3fdfa790d..6861676969 100755 --- a/aio/scripts/_payload-limits.json +++ b/aio/scripts/_payload-limits.json @@ -2,8 +2,8 @@ "aio": { "master": { "uncompressed": { - "runtime": 2712, - "main": 479729, + "runtime": 2768, + "main": 475857, "polyfills": 38453, "prettify": 14913 } diff --git a/aio/src/app/app.component.html b/aio/src/app/app.component.html index 1e7ad72a53..7a35fd6884 100644 --- a/aio/src/app/app.component.html +++ b/aio/src/app/app.component.html @@ -58,7 +58,7 @@
- +