incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r533458 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs: Core.js Window.js
Date Sun, 29 Apr 2007 02:48:09 GMT
Author: awiner
Date: Sat Apr 28 19:48:08 2007
New Revision: 533458

URL: http://svn.apache.org/viewvc?view=rev&rev=533458
Log:
ADFFACES-474: Safari: dialog windows do not size correctly, and errors show in Javascript
console
- The basic problem was that _getWindowForDocument() did not work on Safari,
  as neither document.defaultView or document.parentWindow will return a Window object
- Tweaked the JS to make that function unnecessary (and deleted it)

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=533458&r1=533457&r2=533458
==============================================================================
--- 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
Sat Apr 28 19:48:08 2007
@@ -505,11 +505,11 @@
   var children = element.childNodes;
 
   // XXXSafari: what to do here?
-  var isGecko = _agent.isGecko;
+  var isIE = _agent.isIE;
 
-  var hasContentProp = (isGecko)
-                         ? "tagName"
-                         : "canHaveHTML"
+  var hasContentProp = (isIE)
+                         ? "canHaveHTML"
+                         : "tagName";
   var maxWidth = 0;
 
   for (var i = 0; i < children.length; i++)
@@ -521,7 +521,7 @@
       var currWidth = 0;
       var currOffsetWidth = currChild["offsetWidth"];
 
-      if (isGecko)
+      if (!isIE)
       {
         if ((currOffsetWidth == offsetWidth) ||
             (currOffsetWidth <= 1))
@@ -597,37 +597,13 @@
 }
 
 /**
- * Returns the window for the document
- */
-function _getWindowForDocument(document)
-{
-  if (_agent.isIE)
-  {
-    return document.parentWindow;
-  }
-  else
-  {
-    return document.defaultView;
-  }
-}
-
-/**
  * Safely retrieve the top accessible window
  */
-function _getTop(element)
+function _getTop(currWindow)
 {
-	
-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);
   var currParentWindow = _getParentWindow(currWindow);
-  
+
   while (currParentWindow && (currParentWindow != currWindow))
   {
     currWindow = currParentWindow;
@@ -832,7 +808,7 @@
 
   _pprUnloaded = true;
 
-  var topWindow = _getTop();
+  var topWindow = _getTop(self);
 
   if (!topWindow)
     return;
@@ -1003,7 +979,7 @@
   // the actual contents of the LOV window which are nested
   // within a frame.  So, we check for the _abandoned property
   // on the "top" window.
-  var topWindow = _getTop();
+  var topWindow = _getTop(self);
   
   return topWindow._abandoned;
 }
@@ -4674,7 +4650,7 @@
   // If we're inside a frameset, and the top frame wants
   // reloads blocked, install a _noReload handler.
   // chain _monitor also if that is already set.
-  var topWindow = _getTop();
+  var topWindow = _getTop(self);
   
   if ((self != topWindow) && topWindow["_blockReload"])
   {

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=533458&r1=533457&r2=533458
==============================================================================
--- 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
Sat Apr 28 19:48:08 2007
@@ -613,7 +613,7 @@
       }
     }
 
-    var newWin = _getTop(theWindow.document);
+    var newWin = _getTop(theWindow);
 
     // keep a bottom/right pad of at least 5% of the available screen
     var avLeft = isIE ? 0 : newWin.screen.availLeft;



Mime
View raw message