Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 295269e

Browse files
committed
fix(docs-api): tables overflow screen width on mobile
- fix docs-api layouts to work down to 360px width - fixes Observers, Accessibility, Drag and Drop, Platform, and Overlay layouts - fix DeprecatedconnectedTo to Deprecated connectedTo display issue - update footer copyright - fix exception trying to unsubscribe to undefined routeParamSubscription Fixes #550
1 parent 71de160 commit 295269e

File tree

7 files changed

+40
-21
lines changed

7 files changed

+40
-21
lines changed

src/app/pages/component-category-list/component-category-list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export class ComponentCategoryList implements OnInit, OnDestroy {
3838
}
3939

4040
ngOnDestroy() {
41-
this.routeParamSubscription.unsubscribe();
41+
if (this.routeParamSubscription) {
42+
this.routeParamSubscription.unsubscribe();
43+
}
4244
}
4345
}
4446

src/app/pages/component-sidenav/component-sidenav.service.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,5 @@ import {MatSidenav} from '@angular/material/sidenav';
33

44
@Injectable({providedIn : 'root'})
55
export class ComponentSidenavService {
6-
private _sidenav: MatSidenav;
7-
8-
constructor() {}
9-
10-
get sidenav(): MatSidenav { return this._sidenav; }
11-
12-
set sidenav(value: MatSidenav) { this._sidenav = value; }
6+
sidenav: MatSidenav;
137
}

src/app/pages/component-viewer/component-api.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
API for {{docItem?.id}}
44
</span>
55

6-
<span>
7-
<doc-viewer
8-
documentUrl="/docs-content/api-docs/{{docItem?.packageName}}-{{docItem?.id}}.html"
9-
class="docs-component-view-text-content docs-component-api"
10-
(contentRendered)="updateTableOfContents(docItem!.name, $event)">
11-
</doc-viewer>
6+
<doc-viewer
7+
documentUrl="/docs-content/api-docs/{{docItem?.packageName}}-{{docItem?.id}}.html"
8+
class="docs-component-view-text-content docs-component-api"
9+
(contentRendered)="updateTableOfContents(docItem!.name, $event)">
10+
</doc-viewer>
1211

13-
<doc-viewer *ngFor="let additionalApiDoc of docItem!.additionalApiDocs"
14-
documentUrl="/docs-content/api-docs/{{additionalApiDoc.path}}"
15-
class="docs-component-view-text-content docs-component-api"
16-
(contentRendered)="updateTableOfContents(additionalApiDoc.name, $event)">
17-
</doc-viewer>
18-
</span>
12+
<doc-viewer *ngFor="let additionalApiDoc of docItem!.additionalApiDocs"
13+
documentUrl="/docs-content/api-docs/{{additionalApiDoc.path}}"
14+
class="docs-component-view-text-content docs-component-api"
15+
(contentRendered)="updateTableOfContents(additionalApiDoc.name, $event)">
16+
</doc-viewer>
1917

2018
<table-of-contents #toc
2119
*ngIf="showToc | async"

src/app/pages/component-viewer/component-api.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
}
1212
}
1313

14+
.docs-api-type-alias-name,
15+
.docs-api-class-name {
16+
@media (max-width: 399px) {
17+
word-break: break-word;
18+
}
19+
}
20+
1421
.docs-api-h3 {
1522
font-weight: 300;
1623
font-size: 24px;

src/app/shared/footer/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<div class="docs-footer-copyright">
2020
<div>
21-
<span>Powered by Google ©2010-2019.</span>
21+
<span>Powered by Google ©2010-2020.</span>
2222
<a href="https://github.com/angular/components/blob/master/LICENSE">Code licensed under an MIT-style License.</a>
2323
<span>Documentation licensed under CC BY 4.0.</span>
2424
</div>

src/styles/_api.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// Styles for API docs generated via dgeni from material2 source JsDocs.
22

3+
.docs-api {
4+
max-width: 100%;
5+
}
6+
37
// Top header, e.g., "API documentation for dialog".
48
.docs-api-h2 {
59
font-size: 30px;
@@ -62,6 +66,10 @@
6266
font-size: 12px;
6367
}
6468

69+
.docs-api-deprecated-marker {
70+
margin-right: 8px;
71+
}
72+
6573
.docs-api-module-import,
6674
.docs-api-class-selector-name,
6775
.docs-api-class-export-name {

src/styles/_tables.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
.docs-markdown-td {
2323
font-weight: 400;
2424
padding: 8px 16px;
25+
26+
@media (max-width: $extra-small-breakpoint-width) {
27+
&.docs-api-properties-name-cell,
28+
&.docs-api-method-parameter-cell,
29+
&.docs-api-method-returns-type-cell,
30+
&.docs-api-method-description-cell {
31+
min-width: 80px;
32+
word-break: break-word;
33+
}
34+
}
2535
}
2636

2737

0 commit comments

Comments
 (0)