diff options
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(); |