Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit cdd9152

Browse files
committed
styling + quick link updates
1 parent a73d3b6 commit cdd9152

File tree

7 files changed

+50
-29
lines changed

7 files changed

+50
-29
lines changed

src/app/operators/components/operator-examples/operator-examples.component.html

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@ <h2> Examples </h2>
33
class="code-example"
44
*ngFor="let example of operatorExamples"
55
appHighlightJs>
6-
<h3 [innerHTML]="example.name"></h3>
76
<div class="code-block mat-elevation-z2">
8-
<button mat-icon-button [matMenuTriggerFor]="menu" class="menu-button">
9-
<mat-icon>more_vert</mat-icon>
10-
</button>
11-
<mat-menu #menu="matMenu">
12-
<a
13-
mat-menu-item
14-
[href]="link.url"
15-
target="_blank"
16-
*ngFor="let link of example.externalLinks">
17-
<mat-icon>open_in_new</mat-icon>
18-
<span>{{link.platform}}</span>
19-
</a>
7+
<div class="example-header">
8+
<div class="header-title" [innerHTML]="example.name"></div>
209
<button
21-
mat-menu-item
10+
mat-icon-button
2211
ngxClipboard
23-
[cbContent]="example.code">
12+
[cbContent]="example.code"
13+
matTooltip="Copy">
2414
<mat-icon>content_copy</mat-icon>
25-
<span>Copy To Clipboard</span>
2615
</button>
27-
</mat-menu>
16+
<a
17+
*ngIf="example.externalLink"
18+
mat-icon-button
19+
[href]="example.externalLink.url"
20+
target="_blank"
21+
[matTooltip]="example.externalLink.platform">
22+
<mat-icon>open_in_new</mat-icon>
23+
</a>
24+
</div>
2825
<pre [innerHTML]="example.code"></pre>
2926
</div>
3027
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
.code-block {
22
position: relative;
3+
4+
pre {
5+
margin-top: 0;
6+
padding-top: 0;
7+
}
38
}
49

510
.menu-button {
611
position: absolute;
712
right: 0;
813
top: 0;
914
}
15+
16+
.example-options {
17+
position: absolute;
18+
top: 0;
19+
right: 0;
20+
}
21+
22+
.example-header {
23+
align-content: center;
24+
align-items: center;
25+
display: flex;
26+
justify-content: center;
27+
padding: 8px 18px;
28+
color: rgba(0, 0, 0, 0.692);
29+
background: #fafafa;
30+
31+
.header-title {
32+
flex: 1 1 auto;
33+
}
34+
}

src/app/operators/components/operator-parameters/operator-parameters.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
width: 100%;
77

88
th {
9-
// font-weight: 400;
9+
background-color: #fafafa;
1010
max-width: 100px;
1111
padding: 12px 18px;
1212
text-align: left;
13+
color: rgba(0, 0, 0, 0.692);
14+
font-weight: normal;
1315
}
1416

1517
td {
1618
font-weight: 400;
1719
padding: 8px 16px;
1820
border: 1px solid rgba(0,0,0,.03);
21+
background-color: white;
1922
}
2023
}

src/app/operators/operators.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
MatCardModule,
1010
MatInputModule,
1111
MatMenuModule,
12-
MatButtonModule
12+
MatButtonModule,
13+
MatTooltipModule
1314
} from '@angular/material';
1415
import { ClipboardModule } from 'ngx-clipboard';
1516

@@ -62,7 +63,8 @@ const OPERATOR_ROUTES = [
6263
MatCardModule,
6364
MatInputModule,
6465
MatMenuModule,
65-
MatButtonModule
66+
MatButtonModule,
67+
MatTooltipModule
6668
]
6769
})
6870
export class OperatorsModule { }

src/operator-docs/combination/combineAll.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ export const combineAll: OperatorDoc = {
5555
const result = higherOrder.combineAll();
5656
result.subscribe(x => console.log(x));
5757
`,
58-
'externalLinks': [
59-
{ 'platform': 'JSBin', 'url': 'jsbin.com'},
60-
{ 'platform': 'JSFiddle', 'url': 'https://jsfiddle.net/sba9k56v/'}
61-
]
58+
'externalLink': { 'platform': 'JSBin', 'url': 'http://jsbin.com/peparawuvo/1/edit?js,console,output'}
6259
}
6360
],
6461
'relatedOperators': [ 'combineLatest', 'mergeAll' ],

src/operator-docs/combination/combineLatest.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ export const combineLatest: OperatorDoc = {
5454
*/
5555
bmi.subscribe(x => console.log('BMI is ' + x));
5656
`,
57-
'externalLinks': [
58-
{ 'platform': 'JSBin', 'url': 'jsbin.com'},
59-
{ 'platform': 'JSFiddle', 'url': 'https://jsfiddle.net/sba9k56v/'}
60-
]
57+
'externalLink': { 'platform': 'JSBin', 'url': 'http://jsbin.com/pivowunedu/1/edit?js,console'}
6158
}
6259
],
6360
'relatedOperators': [ 'combineAll', 'merge', 'withLatestFrom' ],

src/operator-docs/operator.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface OperatorParameters {
2828
export interface OperatorExample {
2929
name: string;
3030
code: string;
31-
externalLinks: ExternalLink[];
31+
externalLink: ExternalLink;
3232
}
3333

3434
export interface OperatorExtra {

0 commit comments

Comments
 (0)