Skip to content

Commit 20c3959

Browse files
committed
fix web standards section arrow function
1 parent 6980767 commit 20c3959

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

_includes/examples/dom.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// DOM API
22
var clickMe = document.getElementById('click-me');
3-
clickMe.onclick = () => {
4-
if (this.style.backgroundColor) {
5-
this.style.backgroundColor = '';
6-
} else {
7-
this.style.backgroundColor = 'red';
8-
}
3+
clickMe.onclick = function () {
4+
if (this.style.backgroundColor) {
5+
this.style.backgroundColor = '';
6+
} else {
7+
this.style.backgroundColor = 'red';
8+
}
99
}
1010

1111
// D3 Selection API. Note: it attaches the
1212
// callbacks to each element in the selection
1313
d3.selectAll('.hover-me')
14-
.on('mouseover', () => {
15-
this.style.backgroundColor = 'yellow';
16-
})
17-
.on('mouseleave', () => {
18-
this.style.backgroundColor = '';
19-
});
14+
.on('mouseover', function () {
15+
this.style.backgroundColor = 'yellow';
16+
})
17+
.on('mouseleave', function () {
18+
this.style.backgroundColor = '';
19+
});

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
<link rel="stylesheet" href="{{ "/css/syntax.css" | prepend: site.baseurl }}">
1111
<link rel="stylesheet" href="{{ "/css/graph.css" | prepend: site.baseurl }}">
1212

13-
<script type="text/javascript" src="{{ "/javascripts/d3.v4.min.js" | prepend: site.baseurl }}"></script>
13+
<script type="text/javascript" src="{{ "/javascripts/d3.v5.min.js" | prepend: site.baseurl }}"></script>
1414
</head>

z01-web-standards.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ on the styling.
184184

185185
<div class="example-row-2">
186186
<div class="example">
187-
{% highlight html
188-
%}{% include examples/svg2.svg %}
187+
{% highlight html %}
188+
{% include examples/svg2.svg %}
189189
{% endhighlight %}
190190
</div>
191191

0 commit comments

Comments
 (0)