Simple hack to catch redirections after an ajax request. It is not a clean and perfect solution but it should address most cases.

fix #181
This commit is contained in:
Antoine Nguyen
2012-01-10 10:40:22 +01:00
parent baec1f740e
commit ba0ed344c5
16 changed files with 74 additions and 21 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ var FdMenu = new Class({
if (!confirm(gettext("Delete folder?"))) {
return;
}
new Request.JSON({
new Request.JSON.mdb({
url: evt.target.get("href"),
method: "GET",
onSuccess: function(resp) {
+11 -7
View File
@@ -219,13 +219,17 @@ function refreshFolder() {
profile : "gray",
spinner : true
});
new Request.JSON({url: query, noCache : true, onSuccess: function(resp) {
var callback = ($defined(resp.callback)) ? resp.callback : "default";
new Request.JSON.mdb({
url: query,
noCache : true,
onSuccess: function(resp) {
var callback = ($defined(resp.callback)) ? resp.callback : "default";
current_anchor.get_callback(callback)(resp);
infobox.info(gettext("Done"));
infobox.hide(1);
}}).get();
current_anchor.get_callback(callback)(resp);
infobox.info(gettext("Done"));
infobox.hide(1);
}
}).get();
}
/*
@@ -240,7 +244,7 @@ function simple_request(url, params) {
profile: "gray",
spinner: true
});
new Request.JSON({
new Request.JSON.mdb({
url : url,
onSuccess : function(response) {
if (response.status == "ok") {