opal/opal-jquery/http.rb in opal-jquery-0.1.2 vs opal/opal-jquery/http.rb in opal-jquery-0.2.0
- old
+ new
@@ -46,10 +46,11 @@
settings.type = method;
settings.success = function(data, status, xhr) {
http.body = data;
http.xhr = xhr;
+ http.status_code = xhr.status;
if (typeof(data) === 'object') {
http.json = #{ JSON.from_object `data` };
}
@@ -57,9 +58,10 @@
};
settings.error = function(xhr, status, error) {
http.body = xhr.responseText;
http.xhr = xhr;
+ http.status_code = xhr.status;
return #{ http.fail };
};
}