From 16912f4137f0c728e8e9ca54cfa2be8014f1a3d8 Mon Sep 17 00:00:00 2001 From: dizzy Date: Tue, 9 Nov 2021 12:39:47 -0800 Subject: [Vue] wait for angular to be initialized to post events to avoid loading race condition (#18284) * wait for angular to be initialized to post events to avoid loading race condition * built vue files * ensure vue action is executed when pr is created Co-authored-by: sgiehl Co-authored-by: sgiehl --- plugins/CoreHome/vue/dist/CoreHome.umd.js | 6 ++++-- plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 2 +- plugins/CoreHome/vue/src/Matomo/Matomo.ts | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/CoreHome') diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index b82b424c68..00d50f2dbc 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -360,9 +360,11 @@ Matomo_piwik.postEvent = function postMatomoEvent(eventName) { Matomo_piwik.postEventNoEmit.apply(Matomo_piwik, [eventName].concat(args)); // required until angularjs is removed - var $rootScope = Matomo_piwik.helper.getAngularDependency('$rootScope'); // eslint-disable-line + angular.element(function () { + var $rootScope = Matomo_piwik.helper.getAngularDependency('$rootScope'); // eslint-disable-line - return $rootScope.$oldEmit.apply($rootScope, [eventName].concat(args)); + return $rootScope.$oldEmit.apply($rootScope, [eventName].concat(args)); + }); }; var Matomo = Matomo_piwik; diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 2ed5626cb3..c5a9368621 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -16,7 +16,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var y=window,w=y.piwik,k=y.broadcast,D=y.piwikHelper;w.helper=D,w.broadcast=k,w.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(u=u||document.title,0===u.indexOf(w.siteName))){var n=" - ".concat(p.parse(t,e).getPrettyString()," ");document.title="".concat(w.siteName).concat(n).concat(u.substr(w.siteName.length))}},w.hasUserCapability=function(e){return window.angular.isArray(w.userCapabilities)&&-1!==w.userCapabilities.indexOf(e)},w.on=function(e,t){function n(e){t.apply(void 0,f(e.detail))}t.wrapper=n,window.addEventListener(e,n)},w.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},w.postEventNoEmit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r { + const $rootScope = piwik.helper.getAngularDependency('$rootScope') as any; // eslint-disable-line + return $rootScope.$oldEmit(eventName, ...args); + }); }; const Matomo = piwik; -- cgit v1.2.3