chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1210267 - in /incubator/chukwa/trunk: CHANGES.txt src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java src/main/web/hicc/js/flot.extend.js
Date Sun, 04 Dec 2011 22:55:27 GMT
Author: eyang
Date: Sun Dec  4 22:55:26 2011
New Revision: 1210267

URL: http://svn.apache.org/viewvc?rev=1210267&view=rev
Log:
CHUKWA-614. Updated parent iframe resize code. (Eric Yang)

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java
    incubator/chukwa/trunk/src/main/web/hicc/js/flot.extend.js

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1210267&r1=1210266&r2=1210267&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Sun Dec  4 22:55:26 2011
@@ -102,6 +102,8 @@ Trunk (unreleased changes)
 
   BUG FIXES
 
+    CHUKWA-614. Updated parent iframe resize code. (Eric Yang)
+
     CHUKWA-613. Removed Jersey 1.1 from source code library path. (Eric Yang)
 
     CHUKWA-611. Updated Chukwa tarball to include chukwa-0.5.0-client.jar. (Eric Yang)

Modified: incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java?rev=1210267&r1=1210266&r2=1210267&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java (original)
+++ incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/hicc/Iframe.java Sun Dec
 4 22:55:26 2011
@@ -68,6 +68,8 @@ public class Iframe extends HttpServlet 
     StringBuffer output = new StringBuffer();
     output.append("<html><body><iframe id=\"iframe");
     output.append(id);
+    output.append("\" name=\"iframe");
+    output.append(id);
     output.append("\" src=\"");
     output.append(source);
     output.append("\" width=\"100%\" height=\"");

Modified: incubator/chukwa/trunk/src/main/web/hicc/js/flot.extend.js
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/web/hicc/js/flot.extend.js?rev=1210267&r1=1210266&r2=1210267&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/web/hicc/js/flot.extend.js (original)
+++ incubator/chukwa/trunk/src/main/web/hicc/js/flot.extend.js Sun Dec  4 22:55:26 2011
@@ -80,7 +80,7 @@ function calculateStatis() {
   }
   dataTable+='</table>';
   $('#statisLegend').html(dataTable);
-  // $('.statisTable').flexigrid();
+  setIframeHeight(document.getElementById('boxId').value);
 }
 
 /*
@@ -115,13 +115,6 @@ function wholePeriod() {
   $.plot($("#placeholder"), _series, _options);
   // update statis
   calculateStatis();
-  total_height=height+$("#placeholderTitle").height();
-  if (_options.legend.show) {
-    total_height+=$("#placeholderLegend").height();
-    total_height+=$("#statisLegend").height();
-  }
-  total_height+=25;
-  setIframeHeight(document.getElementById('boxId').value, total_height);
 };
 
 /*
@@ -202,6 +195,7 @@ $("#placeholder").bind("selected", funct
 			   _options, extra_options
 			   )
 		  );
+    setIframeHeight(document.getElementById('boxId').value);
   });
 
 /*
@@ -219,18 +213,12 @@ function getDocHeight(doc) {
 }
 
 /*
- * set the iframe height to the specified height.
+ * auto resize the iframe height to match content.
  */
-function setIframeHeight(ifrm, height) {
+function setIframeHeight(ifrm) {
   try {
-    frame = window.parent.document.getElementById(ifrm);
-    innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
-    objToResize = (frame.style) ? frame.style: frame;
-    if(height==0) {
-      objToResize.height = innerDoc.body.scrollHeight;
-    } else {
-      objToResize.height = height;
-    }
+    objToResize = parent.document.getElementById(window.name);
+    objToResize.height = document.body.scrollHeight;
   } catch(err) {
     window.status = err.message;
   }



Mime
View raw message