Skip to content

Commit

Permalink
Ensure to close visitor popover correctly (#15443)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored and tsteur committed Jan 24, 2020
1 parent 5cdecb0 commit 5322d05
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions plugins/Live/javascripts/visitorProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5322d05

Please sign in to comment.