Skip to content

Commit 1a9995f

Browse files
Merge pull request #9410 from jrafanie/fix-jquery-3-issue
Define a custom script dataType converter, don't override the base one
2 parents 9c35b43 + f1b6313 commit 1a9995f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/javascript/oldjs/jquery_overrides.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $.ajaxSetup({
3636
return jQuery.parseJSON(text);
3737
});
3838
}),
39-
'text script': logError(function(text) {
39+
'text miq_script': logError(function(text) {
4040
if (text.match(/^{/)) {
4141
return jQuery.jsonPayload(text, function(text) {
4242
return text;

app/javascript/oldjs/miq_application.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ window.miqJqueryRequest = function(url, options) {
11231123
};
11241124

11251125
if (options.dataType === undefined) {
1126-
ajax_options.accepts = { script: `*/*;q=0.5, ${$.ajaxSettings.accepts.script}` };
1127-
ajax_options.dataType = 'script';
1126+
ajax_options.accepts = { miq_script: `*/*;q=0.5, ${$.ajaxSettings.accepts.script}` };
1127+
ajax_options.dataType = 'miq_script';
11281128
}
11291129

11301130
// copy selected options over

0 commit comments

Comments
 (0)