incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r530647 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs: Core.js Window.js
Date Fri, 20 Apr 2007 05:07:10 GMT
Author: jwaldman
Date: Thu Apr 19 22:07:09 2007
New Revision: 530647

URL: http://svn.apache.org/viewvc?view=rev&rev=530647
Log:
A better fix for a javascript error when opening up dialogs that will also work when within
iframes.
Reviewed by Blake Sullivan.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Window.js

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?view=diff&rev=530647&r1=530646&r2=530647
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
Thu Apr 19 22:07:09 2007
@@ -617,9 +617,12 @@
 function _getTop(element)
 {
 	
-  var initialDocument = (element && element.ownerDocument)
-                          ? element.ownerDocument
-                          : document;
+var initialDocument = (element)
+                      ? element.ownerDocument
+                        ? element.ownerDocument
+                          // ownerDocument null if element is Document
+                        : element
+                      : document;
   
   // since top might be in another domain, crawl up as high as possible manually
   var currWindow = _getWindowForDocument(initialDocument);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Window.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Window.js?view=diff&rev=530647&r1=530646&r2=530647
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Window.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Window.js
Thu Apr 19 22:07:09 2007
@@ -521,7 +521,7 @@
  * Sizes the window to its preferred size.
  */
 function _sizeWin(
-  element,
+  theWindow,
   extraWidth,
   extraHeight,
   params
@@ -540,11 +540,11 @@
   //         but the implementation appears to be sub-optimal for our case
   if (isGecko)
   {
-    element.window.sizeToContent();
+    theWindow.sizeToContent();
     return;
   }
   */
-  var body =  element.window.document.body;
+  var body =  theWindow.document.body;
 
   if (body)
   {
@@ -613,7 +613,7 @@
       }
     }
 
-    var newWin = _getTop(element);
+    var newWin = _getTop(theWindow.document);
 
     // keep a bottom/right pad of at least 5% of the available screen
     var avLeft = isIE ? 0 : newWin.screen.availLeft;
@@ -627,7 +627,7 @@
       newWidth = maxSWidth;
 
     // Finally, we can resize the window.
-    // element.window.parent.resizeTo(newWidth, newHeight);
+    // theWindow.parent.resizeTo(newWidth, newHeight);
     newWin.resizeTo(newWidth, newHeight);
 
     // Check to make sure that our resize hasn't put the



Mime
View raw message