Skip to content

Commit

Permalink
Ensure to only abort the loading request for a popover when closing it (
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored Feb 8, 2024
1 parent e8be0cf commit b2da9d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/CoreHome/javascripts/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var Piwik_Popover = (function () {
var closeCallback = false;
var isProgrammaticClose = false;
var scrollTopPosition = 0;
var ajaxLoadingRequest = null;

var createContainer = function () {
if (container === false) {
Expand Down Expand Up @@ -63,7 +64,11 @@ var Piwik_Popover = (function () {
container.find('div.jqplot-target').trigger('piwikDestroyPlot');
container[0].innerHTML = '';
container.dialog('destroy').remove();
globalAjaxQueue.abort();

if (ajaxLoadingRequest) {
ajaxLoadingRequest.abort();
}

$('.ui-widget-overlay').off('click.popover');
isOpen = false;
require('piwik/UI').UIControl.cleanupUnusedControls();
Expand Down Expand Up @@ -310,6 +315,8 @@ var Piwik_Popover = (function () {
ajaxRequest.setCallback(callback);
ajaxRequest.setFormat('html');
ajaxRequest.send();

ajaxLoadingRequest = ajaxRequest;
},

isOpen: function() {
Expand Down

0 comments on commit b2da9d0

Please sign in to comment.