Ox.Request: Only invoke callback or trigger error event for requests that have not been cancelled

This commit is contained in:
rlx 2013-07-28 11:53:21 +00:00
parent f8da7fa1fb
commit 9fbafd2039

View file

@ -160,11 +160,11 @@ Ox.Request = (function() {
$element && $element.triggerEvent('request', {
requests: Ox.len(requests)
});
}
if (success) {
options.callback && options.callback(data);
} else {
$element && $element.triggerEvent('error', data);
if (success) {
options.callback && options.callback(data);
} else {
$element && $element.triggerEvent('error', data);
}
}
}