[rhmessaging-commits] rhmessaging commits: r4325 - mgmt/newdata/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Sep 21 18:12:43 EDT 2010


Author: eallen
Date: 2010-09-21 18:12:43 -0400 (Tue, 21 Sep 2010)
New Revision: 4325

Modified:
   mgmt/newdata/cumin/python/cumin/stat.strings
Log:
Force the fullpage chart to be 96% of the window height after that page loads.
There is a catch 22 here, we need to define the flash control's height when the page is generated, but we don't have that height until after the page has loaded. The hack is to do a best guess and then set the actual height immediately after the page loads.

Modified: mgmt/newdata/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/stat.strings	2010-09-21 21:32:52 UTC (rev 4324)
+++ mgmt/newdata/cumin/python/cumin/stat.strings	2010-09-21 22:12:43 UTC (rev 4325)
@@ -348,12 +348,15 @@
         swfobject.embedSWF("resource?name=open-flash-chart.swf", "{id}_chart", "96%", "{height}", "9.0.0", "", 
             {"data-file":"{href}"}, {wmode: "opaque"});
         wooly.addPageUpdateListener(function () { cumin.updateFlashChart('{id}'); });
-        window.addEvent('resize', function () {
+        cumin.forceChart = function () {
             var chart = cumin.getFlashChart('{id}');
             if (chart) {
                 chart.height = window.getSize().y * 0.96;
             }
-        });
+        }
+        // ugly, but it works for now
+        window.addEvent('domready', function () {setTimeout( cumin.forceChart, 1000 )});
+        window.addEvent('resize', cumin.forceChart);
     }
 //]]>
 </script>



More information about the rhmessaging-commits mailing list