Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Butler <kate@innocraft.com>2019-07-26 05:49:03 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-07-26 05:49:03 +0300
commit70e4a7d90bec20cd42a4553e03cf77aac4ea48d7 (patch)
tree8939b5d4c6ba05c96bc35cf586a86d7ed110f959 /plugins/Morpheus
parentf17c7734eee3573a23d6cbfd9da09118c897a6c8 (diff)
Display error message after encountering ajax error in popover (#14424)
* Display error message after encountering ajax error in popover * Remove timeout * Remove check for non-500 errors (e.g. Exceptions) as it doesn't appear to be needed any more * Sanitise error page HTML before displaying it
Diffstat (limited to 'plugins/Morpheus')
-rw-r--r--plugins/Morpheus/javascripts/ajaxHelper.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/Morpheus/javascripts/ajaxHelper.js b/plugins/Morpheus/javascripts/ajaxHelper.js
index c5b91ff3ab..9f1d944849 100644
--- a/plugins/Morpheus/javascripts/ajaxHelper.js
+++ b/plugins/Morpheus/javascripts/ajaxHelper.js
@@ -97,7 +97,7 @@ function ajaxHelper() {
/**
* Callback function to be executed on error
*/
- this.errorCallback = this.defaultErrorCallback;
+ this.errorCallback;
this.withToken = false;
@@ -279,11 +279,18 @@ function ajaxHelper() {
if(status == 'abort') {
return;
}
- $('#loadingError').show();
- setTimeout( function(){
- $('#loadingError').fadeOut('slow');
- }, 2000);
- };
+
+ var loadingError = $('#loadingError');
+ if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) {
+ if (deferred && deferred.status === 500) {
+ $(document.body).html(piwikHelper.escape(deferred.responseText));
+ }
+ } else {
+ loadingError.show();
+ }
+ }
+
+ this.errorCallback = this.defaultErrorCallback;
/**
* Sets the response format for the request