Commit c0bec585 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

fixing status change notification when the server is stopped on longpolling and jsonp modes

parent 8a8a139a
......@@ -196,7 +196,7 @@
if(xhr.status === 200) {
if (settings.success) { settings.success(xhr.responseText); }
} else {
if (settings.error) { settings.error(xhr.status || 304); }
if (settings.error) { settings.error(xhr.status); }
}
}
};
......@@ -259,10 +259,12 @@
var head = document.head || document.getElementsByTagName("head")[0];
var script = document.createElement("script");
var startTime = new Date().getTime();
var onerror = function() {
Ajax.clear(settings);
settings.error(304);
var endTime = new Date().getTime();
settings.error(((endTime - startTime) > settings.timeout/2) ? 304 : 0);
};
var onload = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment