Author: jmorliaguet
Date: Tue May 16 21:27:01 2006
New Revision: 3147

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js

Log:

- fixed the offset



Modified: cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    
(original)
+++ cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    Tue May 
16 21:27:01 2006
@@ -1320,14 +1320,18 @@
       var page_w = window.innerWidth || document.body.clientWidth;
       var page_h = window.innerHeight || document.body.clientHeight;
 
-      page_w = page_w -16;
-      page_h = page_h -16;
+      var offset = Position.realOffset(element);
+      var offsetX = offset[0];
+      var offsetY = offset[1];
+
+      page_w = page_w + offsetX -16;
+      page_h = page_h + offsetY -16;
 
       if (x + width > page_w) x = page_w - width;
-      if (x < 0) x = 0;
+      if (x < offsetX) x = offsetX;
 
       if (y + height > page_h) y = page_h - height;
-      if (y < 0) y = 0;
+      if (y < offsetY) y = offsetY;
     }
     element.setStyle({'left': x + 'px', 'top': y + 'px' });
   }
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to