Skip to content

Commit

Permalink
fix(ui): fix SVG gradients in Firefox and Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Jun 9, 2018
1 parent efbc7bb commit cdccaa1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/app/components/app-line-chart/app-line-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ export class AppLineChartComponent implements OnDestroy, OnChanges {

const totalLengthSuccess = (<any>successPath.node()).getTotalLength();

console.log(document.location.href);

g.append('path')
.attr('d', a(successData as any))
.attr('fill', 'url(#successGradient)');
.attr('fill', `url(${document.location.href}#successGradient)`);

g.selectAll('dot')
.data(successData)
Expand All @@ -226,7 +228,7 @@ export class AppLineChartComponent implements OnDestroy, OnChanges {

g.append('path')
.attr('d', a(failedData as any))
.attr('fill', 'url(#failedGradient)');
.attr('fill', `url(${document.location.href}#failedGradient)`);

g.selectAll('dot')
.data(failedData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class AppProgressChartComponent implements OnChanges, OnDestroy {
this.pathChart = g.append('path')
.datum({ endAngle: 0 })
.attr('d', this.arcLine)
.style('fill', 'url(#progressGradient)');
.style('fill', `url(${document.location.href}#progressGradient)`);

this.middleCount = g.append('text')
.text((d: any) => d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class AppRepositoriesComponent implements OnInit {
this.repositories.forEach((repo: any, i) => {
this.apiService.getBadge(repo.id).subscribe(badge => {
if (badge.ok) {
this.repositories[i].status_badge = badge._body;
this.repositories[i].status_badge = badge._body.replace(/url\(/g, 'url(' + document.location.href);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class AppRepositoryComponent implements OnInit, OnDestroy {
fetchBadge(): void {
this.api.getBadge(parseInt(this.id, 10)).subscribe(event => {
if (event.ok) {
this.statusBadge = event._body.replace(/ \r/g, '').trim();
this.statusBadge = event._body.replace(/ \r/g, '').replace(/url\(/g, 'url(' + document.location.href).trim();
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/fonts.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

+font-face('Ubuntu-Light', '/assets/fonts/Ubuntu-Light', 300, 'normal')
+font-face('Ubuntu-Regular', '/assets/fonts/Ubuntu-Regular', 400, 'normal')
+font-face('Ubuntu-Medium', '/assets/fonts/Ubuntu-SemiBold', 500, 'normal')
+font-face('Ubuntu-Medium', '/assets/fonts/Ubuntu-Medium', 500, 'normal')
+font-face('Ubuntu-Bold', '/assets/fonts/Ubuntu-Bold', 700, 'normal')

$font-family-light: 'Ubuntu-Light', sans-serif
Expand Down

0 comments on commit cdccaa1

Please sign in to comment.