Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2021-11-09 23:39:47 +0300
committerGitHub <noreply@github.com>2021-11-09 23:39:47 +0300
commit16912f4137f0c728e8e9ca54cfa2be8014f1a3d8 (patch)
tree1dfaccc743e9cd9ba14c29b7ea79d716cf87eebf /plugins/CoreHome
parente93efef100fd9312d0420e9e32345d7c83c04c7f (diff)
[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 <stefan@matomo.org> Co-authored-by: sgiehl <sgiehl@users.noreply.github.com>
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r--plugins/CoreHome/vue/dist/CoreHome.umd.js6
-rw-r--r--plugins/CoreHome/vue/dist/CoreHome.umd.min.js2
-rw-r--r--plugins/CoreHome/vue/src/Matomo/Matomo.ts6
3 files changed, 9 insertions, 5 deletions
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;r<t;r++)n[r-1]=arguments[r];var a=new CustomEvent(e,{detail:n});window.dispatchEvent(a)},w.postEvent=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];w.postEventNoEmit.apply(w,[e].concat(n));var a=w.helper.getAngularDependency("$rootScope");return a.$oldEmit.apply(a,[e].concat(n))};var O=w,j=O;
+ */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;r<t;r++)n[r-1]=arguments[r];var a=new CustomEvent(e,{detail:n});window.dispatchEvent(a)},w.postEvent=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];w.postEventNoEmit.apply(w,[e].concat(n)),angular.element((function(){var t=w.helper.getAngularDependency("$rootScope");return t.$oldEmit.apply(t,[e].concat(n))}))};var O=w,j=O;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.ts
index 85d74dfb3b..e2a00bc3b1 100644
--- a/plugins/CoreHome/vue/src/Matomo/Matomo.ts
+++ b/plugins/CoreHome/vue/src/Matomo/Matomo.ts
@@ -65,8 +65,10 @@ piwik.postEvent = function postMatomoEvent(
piwik.postEventNoEmit(eventName, ...args);
// required until angularjs is removed
- const $rootScope = piwik.helper.getAngularDependency('$rootScope') as any; // eslint-disable-line
- return $rootScope.$oldEmit(eventName, ...args);
+ angular.element(() => {
+ const $rootScope = piwik.helper.getAngularDependency('$rootScope') as any; // eslint-disable-line
+ return $rootScope.$oldEmit(eventName, ...args);
+ });
};
const Matomo = piwik;