Skip to content

Commit c28fdd2

Browse files
committed
Open Highcharts credits in a new tab
1 parent f4f6a92 commit c28fdd2

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/doc/changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
- Upgraded to Highcharts 5.0.2
44
- Added experimental support for object event payloads on the wiring input
55
endpoints.
6-
- Added support for displaying messages inside the widget using events
6+
- Added experimental support for displaying messages inside the widget using
7+
events.
8+
- Open Highcharts credits in a new tab.
79

810
## v0.1.0
911

src/js/main.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ window.onload = function () {
2424
data.plotOptions.series.point.events.click = function (e) {
2525
sendData(this); // this :: Point
2626
};
27+
28+
if ("chart" in data) {
29+
data.chart = {};
30+
}
31+
if ("events" in data.chart) {
32+
data.chart.events = {};
33+
}
34+
35+
data.chart.events.load = function () {
36+
this.credits.element.onclick = function () {
37+
window.open(
38+
event.target.options.credits.href,
39+
'_blank'
40+
);
41+
};
42+
};
43+
2744
return data;
2845
};
2946

0 commit comments

Comments
 (0)