myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r906412 - /myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
Date Thu, 04 Feb 2010 09:18:53 GMT
Author: matzew
Date: Thu Feb  4 09:18:52 2010
New Revision: 906412

URL: http://svn.apache.org/viewvc?rev=906412&view=rev
Log:
small correction for TRINIDAD-1695

Modified:
    myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js

Modified: myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?rev=906412&r1=906411&r2=906412&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
(original)
+++ myfaces/trinidad/branches/trinidad-1.0.x/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
Thu Feb  4 09:18:52 2010
@@ -4846,30 +4846,33 @@
     // if possible, use more accurate browser specific methods
     if (_agent.isGecko)
     {
-      var doc = elem.ownerDocument;
-
-      if (doc.getBoxObjectFor === undefined)
-      {
-        var boundingRect = elem.getBoundingClientRect();
-        // top and bottom are not rounded off in Gecko1.9
-        // http://www.quirksmode.org/dom/w3c_cssom.html#elementviewm
-        var elemTop = Math.round(boundingRect.top);
-        var elemLeft = boundingRect.left;
-        var docElement = doc.documentElement;
-        // clientLeft and clientTop would be 0 for Gecko1.9
-        // https://bugzilla.mozilla.org/show_bug.cgi?id=174397#c34
-        elemLeft += docElement.scrollLeft;
-        elemTop += docElement.scrollTop;
-        return {x:elemLeft, y:elemTop};
-      }
-      else
+      TrUIUtils._getElemLoc = function(elem)
       {
-        var box = doc.getBoxObjectFor(elem);
-        var loc = { x: box.screenX, y: box.screenY };
-        box = doc.getBoxObjectFor(doc.documentElement);
-        loc.x -= box.screenX;
-        loc.y -= box.screenY;
-        return loc;        
+        var doc = elem.ownerDocument;
+
+        if (doc.getBoxObjectFor === undefined)
+        {
+          var boundingRect = elem.getBoundingClientRect();
+          // top and bottom are not rounded off in Gecko1.9
+          // http://www.quirksmode.org/dom/w3c_cssom.html#elementviewm
+          var elemTop = Math.round(boundingRect.top);
+          var elemLeft = boundingRect.left;
+          var docElement = doc.documentElement;
+          // clientLeft and clientTop would be 0 for Gecko1.9
+          // https://bugzilla.mozilla.org/show_bug.cgi?id=174397#c34
+          elemLeft += docElement.scrollLeft;
+          elemTop += docElement.scrollTop;
+          return {x:elemLeft, y:elemTop};
+        }
+        else
+        {
+          var box = doc.getBoxObjectFor(elem);
+          var loc = { x: box.screenX, y: box.screenY };
+          box = doc.getBoxObjectFor(doc.documentElement);
+          loc.x -= box.screenX;
+          loc.y -= box.screenY;
+          return loc;        
+        }
       }
     }
     else if(_agent.isIE)



Mime
View raw message