Skip to content

Commit 2ee7899

Browse files
authored
Use status instead of statusText (#3515)
As of HTTP/2 the field statusText can be empty ( See: jquery/api.jquery.com@be6de73 ). Thus the field statusText is no longer relyable to base logic on. The field status of the XMLHttpRequest remains intact, so we can base the logic on that field.
1 parent 4a6524a commit 2ee7899

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/rails_admin/remote-form.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ import * as bootstrap from "bootstrap/dist/js/bootstrap.esm";
105105
document.dispatchEvent(event);
106106

107107
form.bind("ajax:complete", function (event) {
108-
var data = event.detail[0],
109-
status = event.detail[1];
110-
if (status == "OK") {
108+
var data = event.detail[0];
109+
if (data.status == 200) {
111110
var json = $.parseJSON(data.responseText);
112111
var option =
113112
'<option value="' +

0 commit comments

Comments
 (0)