Skip to content

Commit cdccaa1

Browse files
committed
fix(ui): fix SVG gradients in Firefox and Safari
1 parent efbc7bb commit cdccaa1

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/app/components/app-line-chart/app-line-chart.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,11 @@ export class AppLineChartComponent implements OnDestroy, OnChanges {
197197

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

200+
console.log(document.location.href);
201+
200202
g.append('path')
201203
.attr('d', a(successData as any))
202-
.attr('fill', 'url(#successGradient)');
204+
.attr('fill', `url(${document.location.href}#successGradient)`);
203205

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

227229
g.append('path')
228230
.attr('d', a(failedData as any))
229-
.attr('fill', 'url(#failedGradient)');
231+
.attr('fill', `url(${document.location.href}#failedGradient)`);
230232

231233
g.selectAll('dot')
232234
.data(failedData)

src/app/components/app-progress-chart/app-progress-chart.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class AppProgressChartComponent implements OnChanges, OnDestroy {
7272
this.pathChart = g.append('path')
7373
.datum({ endAngle: 0 })
7474
.attr('d', this.arcLine)
75-
.style('fill', 'url(#progressGradient)');
75+
.style('fill', `url(${document.location.href}#progressGradient)`);
7676

7777
this.middleCount = g.append('text')
7878
.text((d: any) => d)

src/app/components/app-repositories/app-repositories.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class AppRepositoriesComponent implements OnInit {
5757
this.repositories.forEach((repo: any, i) => {
5858
this.apiService.getBadge(repo.id).subscribe(badge => {
5959
if (badge.ok) {
60-
this.repositories[i].status_badge = badge._body;
60+
this.repositories[i].status_badge = badge._body.replace(/url\(/g, 'url(' + document.location.href);
6161
}
6262
});
6363
});

src/app/components/app-repository/app-repository.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class AppRepositoryComponent implements OnInit, OnDestroy {
246246
fetchBadge(): void {
247247
this.api.getBadge(parseInt(this.id, 10)).subscribe(event => {
248248
if (event.ok) {
249-
this.statusBadge = event._body.replace(/ \r/g, '').trim();
249+
this.statusBadge = event._body.replace(/ \r/g, '').replace(/url\(/g, 'url(' + document.location.href).trim();
250250
}
251251
});
252252
}

src/styles/fonts.sass

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

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

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

0 commit comments

Comments
 (0)