diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-01-24 05:00:13 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2020-01-24 05:00:13 +0300 |
commit | 5322d058d5afcd2c40e76a13762038e05f0795f3 (patch) | |
tree | 80b25baf6c16ea608352cccf0d71bcd989efddf0 /plugins/Live | |
parent | 5cdecb039600ed93b5fd2de21b68fef3ee730f01 (diff) |
Ensure to close visitor popover correctly (#15443)
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/javascripts/visitorProfile.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/plugins/Live/javascripts/visitorProfile.js b/plugins/Live/javascripts/visitorProfile.js index 021908f2e8..c533561887 100644 --- a/plugins/Live/javascripts/visitorProfile.js +++ b/plugins/Live/javascripts/visitorProfile.js @@ -71,14 +71,27 @@ var self = this, $element = this.$element; - $element.on('click', '.visitor-profile-close', function (e) { - e.preventDefault(); - try { - $element.tooltip('destroy'); - } catch (e) {} - broadcast.propagateNewPopoverParameter(false); - return false; - }); + // if there are no popover params in stack, simply close the popover + if (!broadcast.popoverParamStack.length) { + $element.on('click', '.visitor-profile-close', function (e) { + e.preventDefault(); + try { + $element.tooltip('destroy'); + } catch (e) { + } + Piwik_Popover.close(); + }); + } else { + $element.on('click', '.visitor-profile-close', function (e) { + e.preventDefault(); + try { + $element.tooltip('destroy'); + } catch (e) { + } + broadcast.propagateNewPopoverParameter(false); + return false; + }); + } $element.on('click', '.visitor-profile-toggle-actions', function (e) { e.preventDefault(); |