Fixed bug #7820: Task center iframes are only sized on load (thanks to Steffen Kamper)
authorJeff Segars <jsegars@alumni.rice.edu>
Tue, 1 Apr 2008 14:51:30 +0000 (14:51 +0000)
committerJeff Segars <jsegars@alumni.rice.edu>
Tue, 1 Apr 2008 14:51:30 +0000 (14:51 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3499 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/taskcenter/task/class.mod_user_task.php
typo3/sysext/taskcenter/task/index.php

index 5c3eb1e..bac30ae 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-04-01  Jeff Segars <jeff@webempoweredchurch.org>
 
        * Fixed bug #7943: Filelist has nested HTML (thanks to Steffen Kamper)
+       * Fixed bug #7820: Task center iframes are only sized on load (thanks to Steffen Kamper)
 
 2008-04-01  Benjamin Mack <benni@typo3.org>
 
index baf26ea..52fdc86 100755 (executable)
@@ -201,7 +201,7 @@ class mod_user_task extends t3lib_extobjbase {
         * @return      string          code that inserts the iframe (HTML)
         */
        function urlInIframe($url,$max=0) {
-               return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" frameborder="no" style="border: none;"></iframe>';
+               return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" id="list_frame" frameborder="no" style="border: none;"></iframe>';
        }
 
 
index 0f40618..3044ba3 100755 (executable)
@@ -94,6 +94,7 @@ class SC_mod_user_task_index extends t3lib_SCbase {
                $this->doc->divClass = '';
                $this->doc->form = '<form action="index.php" method="POST" name="editform">';
                $this->backPath = $this->doc->backPath = $BACK_PATH;
+               $this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
                $this->doc->JScode = '  <script language="javascript" type="text/javascript">
                        script_ended = 0;
                        function jumpToUrl(URL) {
@@ -105,17 +106,16 @@ class SC_mod_user_task_index extends t3lib_SCbase {
                $this->doc->JScode .= $this->doc->getDynTabMenuJScode();
                $this->doc->JScode .= '<script language="javascript" type="text/javascript">
                function resizeIframe(frame,max) {
-                       try {
-                               innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
-                               if(max==0) {
-                                       frame.height = innerDoc.body.scrollHeight + 30;
-                               } else {
-                                       frame.height = Math.max(innerDoc.body.scrollHeight + 30,document.body.scrollHeight);
-                               }
-                       }
-                       catch (e) {
-                               window.status = e.message;
-                       }
+                       var parent = $("list_frame").up("body");
+                       var parentHeight = $(parent).getHeight();
+                       $("list_frame").setStyle({height: parentHeight+"px"});
+                       
+               }
+               // event crashes IE6 so he is excluded first
+               //TODO: use a central handler instead of multiple single ones
+               var version = parseFloat(navigator.appVersion.split(\';\')[1].strip().split(\' \')[1]);
+               if (!(Prototype.Browser.IE && version == 6)) {
+                       Event.observe(window, "resize", resizeIframe, false);
                }
 </script>';