8000 Fixed use of arrow function in inline JavaScript for overrides · squidfunk/mkdocs-material@95cc609 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95cc609

Browse files
committed
Fixed use of arrow function in inline JavaScript for overrides
1 parent 7b3ad8c commit 95cc609

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

material/overrides/main.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,5 @@
5353
{% endblock %}
5454
{% block analytics %}
5555
{{ super() }}
56-
<script>
57-
document.addEventListener("DOMContentLoaded", function() {
58-
document.body.addEventListener("click", ev => {
59-
if (ev.target instanceof HTMLElement) {
60-
var el = ev.target.closest("a[href^=http]")
61-
if (el)
62-
ga("send", "event", "outbound", "click", el.href)
63-
}
64-
})
65-
})
66-
</script>
56+
<script>document.addEventListener("DOMContentLoaded",function(){document.body.addEventListener("click",function(e){if(e.target instanceof HTMLElement){var t=e.target.closest("a[href^=http]");t&&ga("send","event","outbound","click",t.href)}})})</script>
6757
{% endblock %}

src/overrides/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<!-- Track external links -->
100100
<script>
101101
document.addEventListener("DOMContentLoaded", function() {
102-
document.body.addEventListener("click", ev => {
102+
document.body.addEventListener("click", function(ev) {
103103
if (ev.target instanceof HTMLElement) {
104104
var el = ev.target.closest("a[href^=http]")
105105
if (el)

0 commit comments

Comments
 (0)
0