diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-11-12 05:40:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 05:40:50 +0300 |
commit | 0e53a20b235f5edd5ec98aab1c9daad48a88d46f (patch) | |
tree | 6f7f6a7ce1f2f6ece044907c71581fa89db65382 /plugins/CoreHome/vue/src/Matomo | |
parent | 1e4af959702fb184001db899bfb6ac5f8c12c85a (diff) |
[Vue] Cannot return IAngularEvent in $emit wrapper unfortunately. (#18296)
* Cannot return IAngularEvent in $emit wrapper unfortunately.
* built vue files
Diffstat (limited to 'plugins/CoreHome/vue/src/Matomo')
-rw-r--r-- | plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts | 4 | ||||
-rw-r--r-- | plugins/CoreHome/vue/src/Matomo/Matomo.ts | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts index 8ea591fca7..0ab71e38ef 100644 --- a/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts @@ -18,7 +18,9 @@ function initPiwikService(piwik: PiwikGlobal, $rootScope: IRootScopeService) { // overwrite $rootScope so all events also go through Matomo.postEvent(...) too. ($rootScope as any).$oldEmit = $rootScope.$emit; // eslint-disable-line $rootScope.$emit = function emitWrapper(name: string, ...args: any[]): IAngularEvent { // eslint-disable-line - return Matomo.postEvent(name, ...args); + Matomo.postEvent(name, ...args); + // can't always get the result. it's not really used in angularjs though, so it should be ok. + return null as unknown as IAngularEvent; }; ($rootScope as any).$oldBroadcast = $rootScope.$broadcast; // eslint-disable-line diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.ts index e2a00bc3b1..30b821f403 100644 --- a/plugins/CoreHome/vue/src/Matomo/Matomo.ts +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.ts @@ -5,7 +5,6 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import { IAngularEvent } from 'angular'; import Periods from '../Periods/Periods'; let originalTitle: string; @@ -61,13 +60,13 @@ piwik.postEventNoEmit = function postEventNoEmit( piwik.postEvent = function postMatomoEvent( eventName: string, ...args: any[] // eslint-disable-line -): IAngularEvent { +): void { piwik.postEventNoEmit(eventName, ...args); // required until angularjs is removed - angular.element(() => { + window.angular.element(() => { const $rootScope = piwik.helper.getAngularDependency('$rootScope') as any; // eslint-disable-line - return $rootScope.$oldEmit(eventName, ...args); + $rootScope.$oldEmit(eventName, ...args); }); }; |