File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ define([
62
62
63
63
if ( jqXHR . readyState === 4 ) {
64
64
try {
65
- $ ( 'body' ) . notification ( 'clearCallbackError' ) ;
66
65
jsonObject = JSON . parse ( jqXHR . responseText ) ;
66
+
67
67
if ( jsonObject . ajaxExpired && jsonObject . ajaxRedirect ) { //eslint-disable-line max-depth
68
68
window . location . replace ( jsonObject . ajaxRedirect ) ;
69
69
}
@@ -73,10 +73,15 @@ define([
73
73
74
74
/**
75
75
* Error callback.
76
+ *
77
+ * @param {Object } jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
78
+ * @param {String } textStatus
76
79
*/
77
- error : function ( ) {
78
- $ ( 'body' ) . notification ( 'clear' )
79
- . notification ( 'add' , {
80
+ error : function ( jqXHR , textStatus ) {
81
+
82
+ $ ( 'body' ) . notification ( 'clear' ) ;
83
+ if ( jqXHR . readyState !== 0 && textStatus !== 'abort' ) {
84
+ $ ( 'body' ) . notification ( 'add' , {
80
85
error : true ,
81
86
message : $ . mage . __ (
82
87
'A technical problem with the server created an error. ' +
@@ -87,11 +92,12 @@ define([
87
92
* @param {String } message
88
93
*/
89
94
insertMethod : function ( message ) {
90
- var $wrapper = $ ( '<div class="callback" ></div>' ) . html ( message ) ;
95
+ var $wrapper = $ ( '<div></div>' ) . html ( message ) ;
91
96
92
97
$ ( '.page-main-actions' ) . after ( $wrapper ) ;
93
98
}
94
99
} ) ;
100
+ }
95
101
}
96
102
} ) ;
97
103
Original file line number Diff line number Diff line change @@ -77,13 +77,6 @@ define([
77
77
*/
78
78
clear : function ( ) {
79
79
$ ( this . placeholder ) . html ( '' ) ;
80
- } ,
81
-
82
- /**
83
- * Remove generic callback error message
84
- */
85
- clearCallbackError : function ( ) {
86
- $ ( 'body' ) . find ( '.callback .messages .message-error' ) . parent ( ) . html ( '' ) ;
87
80
}
88
81
} ) ;
89
82
You can’t perform that action at this time.
0 commit comments