1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 15:40:15 +01:00

Fixed use of arrow function in inline JavaScript for overrides

This commit is contained in:
squidfunk 2020-08-23 17:20:09 +02:00
parent 7b3ad8c7de
commit 95cc609087
2 changed files with 2 additions and 12 deletions

View File

@ -53,15 +53,5 @@
{% endblock %} {% endblock %}
{% block analytics %} {% block analytics %}
{{ super() }} {{ super() }}
<script> <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>
document.addEventListener("DOMContentLoaded", function() {
document.body.addEventListener("click", ev => {
if (ev.target instanceof HTMLElement) {
var el = ev.target.closest("a[href^=http]")
if (el)
ga("send", "event", "outbound", "click", el.href)
}
})
})
</script>
{% endblock %} {% endblock %}

View File

@ -99,7 +99,7 @@
<!-- Track external links --> <!-- Track external links -->
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
document.body.addEventListener("click", ev => { document.body.addEventListener("click", function(ev) {
if (ev.target instanceof HTMLElement) { if (ev.target instanceof HTMLElement) {
var el = ev.target.closest("a[href^=http]") var el = ev.target.closest("a[href^=http]")
if (el) if (el)