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