From 3be98774efe2b736391cf3ed302ef1de3e66515c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 12 Sep 2019 10:23:57 +0200 Subject: [PATCH] wip #3037 @0:15 --- resources/public/js/gtag.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/public/js/gtag.js b/resources/public/js/gtag.js index c029730..4719ae0 100644 --- a/resources/public/js/gtag.js +++ b/resources/public/js/gtag.js @@ -1,3 +1,7 @@ +var matches = function matches(element, selector) { + return element.matches ? element.matches(selector) : element.msMatchesSelector ? element.msMatchesSelector(selector) : element.webkitMatchesSelector ? element.webkitMatchesSelector(selector) : null; +}; + function cubistga() { this.initEvents(); } @@ -11,7 +15,7 @@ cubistga.prototype.initEvents = function () { }); document.addEventListener('click', function (e) { - if (e.target.matches('a[data-ga]')) { + if (matches(e.target,'a[data-ga]')) { $this.handleGtag(e.target); } if (e.target.closest('a[data-ga]')) { -- 2.39.5