[rhmessaging-commits] rhmessaging commits: r3404 - in mgmt/trunk/cumin: resources and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu May 28 16:19:49 EDT 2009


Author: eallen
Date: 2009-05-28 16:19:48 -0400 (Thu, 28 May 2009)
New Revision: 3404

Modified:
   mgmt/trunk/cumin/python/cumin/stat.strings
   mgmt/trunk/cumin/resources/app.js
Log:
Remove the loading animation after 1 minute.

Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings	2009-05-28 20:18:50 UTC (rev 3403)
+++ mgmt/trunk/cumin/python/cumin/stat.strings	2009-05-28 20:19:48 UTC (rev 3404)
@@ -114,6 +114,9 @@
         loading.style.visibility = "hidden";
         loading.style.display = "block";
         var left = (img.getSize().x - loading.getSize().x) / 2;
+        if (left < 0) {
+            left = '25%';
+        }
         loading.setStyles({
             left: left,
             display: 'block',
@@ -121,6 +124,12 @@
         });
     }
 }
+function hideLoading(id) {
+    $(id).getElement(".loading").setStyles({
+        display: 'none',
+        visibility: 'hidden'
+    });
+}
 
 function changeDuration(state, a, id) {
     li = a.parentNode;
@@ -136,10 +145,10 @@
         branch.duration = state;
         src = branch.marshal();
         src = cumin.refreshTime(src);
+        oImg.src = src;
 
-        $(oImg).onload = function () {this.className = ""};
+        $(oImg).onerror = $(oImg).onload = function () {this.className = ""};
         oImg.className = "Loading";
-        oImg.src = src;
 
         var hash = wooly.session.hash();
         hash[id] = state;
@@ -148,6 +157,7 @@
     var loading = $(id).getElement(".loading");
     loading.loading = true;
     setTimeout("showLoading('"+id+"')", 1000);
+    setTimeout("hideLoading('"+id+"')", 1000 * 60);
 
     return false;
 }

Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js	2009-05-28 20:18:50 UTC (rev 3403)
+++ mgmt/trunk/cumin/resources/app.js	2009-05-28 20:19:48 UTC (rev 3404)
@@ -118,10 +118,16 @@
 
                 src = cumin.refreshTime(src);
                 oImg.className = "Loading";
+                oImg.onerror = oImg.onload = function () {this.className = ""};
                 oImg.width = width;
                 oImg.height = height;
                 oImg.style.visibility = "hidden";
                 oImg.src = src;
+
+                var loading = $(id).getElement(".loading");
+                loading.loading = true;
+                setTimeout("showLoading('"+id+"')", 1000);
+                setTimeout("hideLoading('"+id+"')", 1000 * 60);
             }
         }
 




More information about the rhmessaging-commits mailing list