geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r897153 - in /geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes: navigation.jsp portlets-with-tree.jsp
Date Fri, 08 Jan 2010 10:15:06 GMT
Author: genspring
Date: Fri Jan  8 10:15:01 2010
New Revision: 897153

URL: http://svn.apache.org/viewvc?rev=897153&view=rev
Log:
GERONIMO-4994 return to the top after clicking a menu item(navigation.jsp), refactor the resizing
of iframe(portlets-with-tree.jsp).

Modified:
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp?rev=897153&r1=897152&r2=897153&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
Fri Jan  8 10:15:01 2010
@@ -160,13 +160,21 @@
 
    }
 
-   function displayPortlets(anchor){
-           document.getElementById('content').style.display = 'none';
-        document.getElementById("portletsFrame").src = anchor.href+"?formId="+formID; 
+    function displayPortlets(anchor){
+
+        document.getElementById('content').style.display = 'none';
+        document.getElementById("portletsFrame").src = anchor.href+"?formId="+formID;
+        setTimeout('returnToTop()', 30);
+     }
+     
+    function returnToTop(){
+        window.scrollTo(0,0);
+        return false;
      }
+     
        
 
-   dojo.addOnLoad(load);
+    dojo.addOnLoad(load);
         
 </script>
 

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp?rev=897153&r1=897152&r2=897153&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp
Fri Jan  8 10:15:01 2010
@@ -23,16 +23,29 @@
 
 <script language="JavaScript">
 
-function autoResize(id){
-    var newheight;
+var iframeId;
 
-    if(document.getElementById){
-        newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
-    }
+function delayResize(id){
+    iframeId=id;
+    <%--delay the resize so that the ajax content get loaded before the resizing.--%>
+    setTimeout('autoResize()',300); 
+}
+
+function autoResize(){
 
-    document.getElementById(id).height= (newheight) + "px";
+  try{
+    frame = document.getElementById(iframeId);
+    frame_document = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
+    objToResize = (frame.style) ? frame.style : frame;
+    objToResize.height = frame_document.body.scrollHeight + 10;
+  }
+  catch(err){
+    window.status = err.message;
+  }
 
 }
+
+
 </script>
 
 <!-- start accessibility prolog -->
@@ -96,7 +109,7 @@
 
                 </div>
                 
-                    <iframe  src="" id="portletsFrame" width="100%" height="100%" scrolling="no"
frameborder="0" onload='autoResize("portletsFrame")'>
+                    <iframe  src="" id="portletsFrame" width="100%" height="100%" scrolling="no"
frameborder="0" onload="if (window.parent && window.parent.delayResize) {window.parent.delayResize('portletsFrame');}">
                     
                     </iframe>
                     </td>



Mime
View raw message