in Ox.Request, allow for 409 Conflict

This commit is contained in:
rlx 2011-10-31 16:02:00 +00:00
parent 496da6aa77
commit 63b61f520b
2 changed files with 10 additions and 5 deletions

View file

@ -193,15 +193,20 @@ Ox.Request = function(options) {
}; };
} }
} }
if (data.status.code == 200 || data.status.code == 404) { if (
// we have to include 404 so we can data.status.code == 200
// test for the existence of things || data.status.code == 404
|| data.status.code == 409
) {
// we have to include not found and conflict
// so that handlers can handle these cases
cache[req] = { cache[req] = {
data: data, data: data,
time: Ox.getTime() time: Ox.getTime()
}; };
callback(data); callback(data);
} else if (data.status.code >= 400 && data.status.code < 500) { } else if (data.status.code == 401 || data.status.code == 403) {
// unauthorized or forbidden
var $dialog = Ox.Dialog({ var $dialog = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({

View file

@ -1377,7 +1377,7 @@ Ox.List = function(options, self) {
bValue = sort[b.id], bValue = sort[b.id],
ret = 0 ret = 0
if (aValue < bValue) { if (aValue < bValue) {
ret = operator == '+' ? -1 : 1 ret = operator == '+' ? -1 : 1;
} else if (aValue > bValue) { } else if (aValue > bValue) {
ret = operator == '+' ? 1 : -1; ret = operator == '+' ? 1 : -1;
} }