[rhmessaging-commits] rhmessaging commits: r3284 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Apr 13 13:51:07 EDT 2009


Author: eallen
Date: 2009-04-13 13:51:06 -0400 (Mon, 13 Apr 2009)
New Revision: 3284

Modified:
   mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Disable auto-update of charts while duration is being switched (allows charts that take longer than the update interval to be drawn).
Change style of chart while duration is being switched.

Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings	2009-04-13 17:25:15 UTC (rev 3283)
+++ mgmt/trunk/cumin/python/cumin/stat.strings	2009-04-13 17:51:06 UTC (rev 3284)
@@ -71,6 +71,10 @@
 div.StatValueChart img {
     margin: 0 0 0 1em;
 }
+div.StatValueChart img.Loading {
+    opacity: 0.5;
+    cursor: wait;
+}
 
 [JSDurationSwitch.javascript]
 function changeDuration(state, a, id) {
@@ -87,9 +91,13 @@
         branch.duration = state;
         src = branch.marshal();
         src = cumin.refreshTime(src);
+
+        $(oImg).addEvent('load', function () {this.className = ""});
+        oImg.className = "Loading";
         oImg.src = src;
     }
     return false;
+
 }
 
 [StatValueChart.html]
@@ -101,13 +109,17 @@
   <img id="{id}" src="{href}" height="{height}" width="{width}" alt="stats" />
 </div>
 <script type="text/javascript">
+//<![CDATA[
 (function() {
     function update() {
+        if (document.images["{id}"].className == "Loading")
+            return;
         cumin.updateChart("{id}");
     }
 
     wooly.addPageUpdateListener(update);
 }())
+//]]>
 </script>
 
 [StatValueChart.stat_html]
@@ -143,13 +155,14 @@
         src = branch.marshal();
 
         src = cumin.refreshTime(src);
-        oImg.style.visibility = "hidden"
+        oImg.style.visibility = "hidden";
         oImg.src = src;
     }
 }
     $('{id}').onfullpage = function (width, height) { stackedNotify(true, width, height); };
     $('{id}').onrestore = function () { stackedNotify(false, {width}, 100); };
-    document.images['{id}'].onload = function () {this.style.visibility = "visible"};
-    document.images['{id}'].ondblclick = function () {fullpage(this.parentNode.parentNode.parentNode.getElementsByTagName('p')[0])};
+    var oImg = document.images['{id}'];
+    $(oImg).addEvent('load', function () { this.style.visibility = "visible" });
+    $(oImg).addEvent('dblclick', function () {fullpage(this.parentNode.parentNode.parentNode.getElementsByTagName('p')[0])});
 //]]>
 </script>




More information about the rhmessaging-commits mailing list