diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-01-23 22:57:38 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2020-01-23 22:57:38 +0300 |
commit | 45dd3a9e5c6513f48ed55b51ecda185fb4bdf837 (patch) | |
tree | fa29666780eda6f4e84e46ee20ba0bc488506465 /plugins/CoreHome | |
parent | 1db55e38c5ac47f1b964b08585efcfb6e62c0a6d (diff) |
Fix popover stack behaviour (#15444)
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r-- | plugins/CoreHome/javascripts/popover.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/CoreHome/javascripts/popover.js b/plugins/CoreHome/javascripts/popover.js index 19590d5b86..989de673a1 100644 --- a/plugins/CoreHome/javascripts/popover.js +++ b/plugins/CoreHome/javascripts/popover.js @@ -35,6 +35,8 @@ var Piwik_Popover = (function () { } $('.ui-widget-overlay').on('click.popover', function () { + // if clicking outside of the dialog, close entire stack + broadcast.resetPopoverStack(); container.dialog('close'); }); @@ -47,11 +49,6 @@ var Piwik_Popover = (function () { }, 0); }, close: function (event, ui) { - // if clicking outside of the dialog, close entire stack - if (!event.currentTarget && !$(event.currentTarget).is('button')) { - broadcast.resetPopoverStack(); - } - container.find('div.jqplot-target').trigger('piwikDestroyPlot'); container[0].innerHTML = ''; container.dialog('destroy').remove(); @@ -70,7 +67,7 @@ var Piwik_Popover = (function () { // if we were not called by Piwik_Popover.close(), then the user clicked the close button or clicked // the overlay, in which case we want to handle the popover URL as well as the actual modal. - if (!isProgrammaticClose) { + if (!isProgrammaticClose || isEscapeKey(event)) { broadcast.propagateNewPopoverParameter(false); } } |