Author: eallen
Date: 2009-05-28 15:02:13 -0400 (Thu, 28 May 2009)
New Revision: 3402
Modified:
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Center the loading animation
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-05-28 15:58:29 UTC (rev 3401)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-05-28 19:02:13 UTC (rev 3402)
@@ -107,9 +107,18 @@
[JSDurationSwitch.javascript]
function showLoading(id) {
- var loading = $(id).getElement(".loading");
+ var container = $(id);
+ var loading = container.getElement(".loading");
+ var img = container.getElement("img");
if (loading.loading) {
- loading.setStyle('display', 'block');
+ loading.style.visibility = "hidden";
+ loading.style.display = "block";
+ var left = (img.getSize().x - loading.getSize().x) / 2;
+ loading.setStyles({
+ left: left,
+ display: 'block',
+ visibility: 'visible'
+ });
}
}
@@ -128,7 +137,7 @@
src = branch.marshal();
src = cumin.refreshTime(src);
- $(oImg).addEvent('load', function () {this.className = ""});
+ $(oImg).onload = function () {this.className = ""};
oImg.className = "Loading";
oImg.src = src;
Show replies by date