Author: woonsan
Date: Fri Oct 30 16:44:27 2009
New Revision: 831378

URL: http://svn.apache.org/viewvc?rev=831378&view=rev
Log:
APA-19: Adding comparison of offsetHeight with scrollHeight if it is available.

Modified:
    
portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_handler.js

Modified: 
portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_handler.js
URL: 
http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_handler.js?rev=831378&r1=831377&r2=831378&view=diff
==============================================================================
--- 
portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_handler.js
 (original)
+++ 
portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_handler.js
 Fri Oct 30 16:44:27 2009
@@ -17,7 +17,10 @@
 function iframePortlet_resetHeight(iframe) {
   try {
     if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight) {
-      iframe.height = iframe.contentDocument.body.offsetHeight + 16;
+      var offsetHeight = iframe.contentDocument.body.offsetHeight;
+      if (iframe.contentDocument.body.scrollHeight && 
iframe.contentDocument.body.scrollHeight > offsetHeight)
+        offsetHeight = iframe.contentDocument.body.scrollHeight;
+      iframe.height = offsetHeight + 16;
     } else if (iframe.Document && iframe.Document.body.scrollHeight) {
       iframe.height = iframe.Document.body.scrollHeight;
     }


Reply via email to