diff options
author | Stefan Giehl <stefan@piwik.org> | 2017-05-09 10:55:15 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-05-09 10:55:15 +0300 |
commit | defc5469a5d4634d64023477a447a31c58812a12 (patch) | |
tree | 0636caff6c4ad915700688e80f6c3cde0c0355e1 /plugins/CoreHome/javascripts/broadcast.js | |
parent | 292b4bd83e0128a2a1802fc5b34d3c1d6f2eeb53 (diff) |
Prevent removing page content when opening rowaction in widgetize mode (#11644)
* prevent removing page content when opening rowaction in widgetize mode
* adds test to show rowevolution in widgetized dashboard
* init only in widgetize mode
* fix ui test
* fix ui test
Diffstat (limited to 'plugins/CoreHome/javascripts/broadcast.js')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index d279598039..a58868261f 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -92,6 +92,7 @@ var broadcast = { hash = (''+hash).substr(1); } + if (hash) { if (/^popover=/.test(hash)) { @@ -124,7 +125,7 @@ var broadcast = { popoverParamUpdated = (popoverParam != ''); } - if (pageUrlUpdated || broadcast.forceReload) { + if (!broadcast.isWidgetizedDashboard() && (pageUrlUpdated || broadcast.forceReload)) { Piwik_Popover.close(); if (hashUrl != broadcast.currentHashUrl || broadcast.forceReload) { @@ -159,10 +160,16 @@ var broadcast = { } else { // start page Piwik_Popover.close(); - $('.pageWrap #content:not(.admin)').empty(); + if (!broadcast.isWidgetizedDashboard()) { + $('.pageWrap #content:not(.admin)').empty(); + } } }, + isWidgetizedDashboard: function() { + return broadcast.getValueFromUrl('module') == 'Widgetize' && broadcast.getValueFromUrl('moduleToWidgetize') == 'Dashboard'; + }, + /** * Returns if the current page is the login page * @return {boolean} @@ -425,7 +432,9 @@ var broadcast = { */ propagateNewPopoverParameter: function (handlerName, value) { // init broadcast if not already done (it is required to make popovers work in widgetize mode) - //broadcast.init(true); + if (broadcast.isWidgetizedDashboard()) { + broadcast.init(true); + } var $location = angular.element(document).injector().get('$location'); |