diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-04-12 15:31:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 15:31:32 +0300 |
commit | 7144bfdf7993b15dacda016fcfce5d29f1e1c7db (patch) | |
tree | 8083d2d37850d885c5f52702bb70d827207f8d9e /plugins/Dashboard | |
parent | c51f8f21ac3b46fed57081908d6cfebfe6e22e27 (diff) |
[Vue] changes for AnonymousPiwikUsageMeasurement (#19079)
* adding events for use with AnonymousPiwikUsageMeasurement (so angularjs does not have to be used)
* adding more events and changes required for AnonymousPiwikUsageMeasurement
* undo submodule change
* bump version to beta for plugin tests
* built vue files
* revert submodule change
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Dashboard')
-rw-r--r-- | plugins/Dashboard/javascripts/dashboard.js | 4 | ||||
-rw-r--r-- | plugins/Dashboard/javascripts/dashboardObject.js | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/plugins/Dashboard/javascripts/dashboard.js b/plugins/Dashboard/javascripts/dashboard.js index cd7c62d5f6..e4157c2465 100644 --- a/plugins/Dashboard/javascripts/dashboard.js +++ b/plugins/Dashboard/javascripts/dashboard.js @@ -169,6 +169,8 @@ function copyDashboardToUser() { var DashboardSettingsControlBase = function (element) { UIControl.call(this, element); + window.CoreHome.Matomo.postEvent('Dashboard.DashboardSettings.mounted', $(element)[0]); + // on menu item click, trigger action event on this var self = this; this.$element.on('click', 'ul.submenu li[data-action]', function (e) { @@ -222,6 +224,8 @@ function copyDashboardToUser() { $.extend(DashboardSettingsControlBase.prototype, UIControl.prototype, { _destroy: function () { + window.CoreHome.Matomo.postEvent('Dashboard.DashboardSettings.unmounted', this.$element[0]); + UIControl.prototype._destroy.call(this); $('body').off('mouseup', null, this.onBodyMouseUp); diff --git a/plugins/Dashboard/javascripts/dashboardObject.js b/plugins/Dashboard/javascripts/dashboardObject.js index 1308d1a7a3..de9455c372 100644 --- a/plugins/Dashboard/javascripts/dashboardObject.js +++ b/plugins/Dashboard/javascripts/dashboardObject.js @@ -4,6 +4,7 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + (function ($) { var layoutColumnSelector = '#dashboardWidgetsArea > .col'; @@ -61,6 +62,8 @@ generateLayout(options.layout); } + window.CoreHome.Matomo.postEvent('Dashboard.Dashboard.mounted', { element: this }); + return this; }, @@ -70,6 +73,10 @@ * @return void */ destroy: function () { + if (dashboardElement && dashboardElement.length) { + window.CoreHome.Matomo.postEvent('Dashboard.Dashboard.unmounted', {element: dashboardElement[0]}); + } + $(dashboardElement).remove(); dashboardElement = null; destroyWidgets(); |