wip: webmail big refactoring and perfomance improvment

Misc. changes.
This commit is contained in:
Antoine Nguyen
2011-12-01 17:36:21 +01:00
parent b9061b7f4a
commit c7cfac8e0a
13 changed files with 251 additions and 93 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ div.right {
.logo {
float: right;
/*margin: 5px 0 0 5px;*/
height: 90px;
height: 80px;
}
.dropdown {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

+32 -7
View File
@@ -9,7 +9,9 @@ var AnchorNavigation = new Class({
checkinterval: 300,
defloadingtext: gettext("Loading..."),
defloadingcolor: "gray",
defcallback: null
defcallback: null,
spin_disabled: false,
spin_target: undefined
},
initialize: function(deflocation, options) {
@@ -29,6 +31,17 @@ var AnchorNavigation = new Class({
}
},
/*
* Disable the spinner.
*/
disable_spinner: function() {
this.options.spin_disabled = true;
},
enable_spinner: function() {
this.options.spin_disabled = false;
},
reset_loading_infos: function() {
this.loading_message = this.options.defloadingtext;
this.loading_color = this.options.defloadingcolor;
@@ -200,22 +213,34 @@ var AnchorNavigation = new Class({
var query = this.serialized.substring(1);
infobox.show(this.loading_message, {
profile: this.loading_color,
spinner: true
});
if (!this.options.spin_disabled) {
var target = this.options.spin_target ? this.options.spin_target
: document.body;
$(target).spin({
message: this.loading_message
});
/*infobox.show(this.loading_message, {
profile: this.loading_color,
spinner: true
});*/
}
new Request.JSON({
url: query,
noCache : true,
onSuccess: function(resp) {
if (!this.options.spin_disabled) {
var target = this.options.spin_target ? this.options.spin_target
: document.body;
$(target).unspin();
}
if (resp.status == "ko") {
infobox.error(resp.respmsg);
return;
}
var callback = ($defined(resp.callback)) ? resp.callback : "default";
this.callbacks[callback](resp);
infobox.info(gettext("Done"));
infobox.hide(1);
/*infobox.info(gettext("Done"));
infobox.hide(1);*/
this.reset_loading_infos();
}.bind(this),
onFailure: function(xhr) {