Author: sdumitriu
Date: 2008-02-18 02:58:04 +0100 (Mon, 18 Feb 2008)
New Revision: 7784

Modified:
   
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/ajax/panelWizard.js
   
xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/ajax/panelWizard.js
Log:
XSTOUCAN-1: Create Toucan skin from xwiki.org
Fixed: While dragging panels, sometimes their position is wrong


Modified: 
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/ajax/panelWizard.js
===================================================================
--- 
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/ajax/panelWizard.js
       2008-02-18 01:22:43 UTC (rev 7783)
+++ 
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/ajax/panelWizard.js
       2008-02-18 01:58:04 UTC (rev 7784)
@@ -104,8 +104,10 @@
   realParent = el.parentNode;
   parentNode = el.parentNode;
   var isAdded = (realParent != leftPanels && realParent != rightPanels);
-  var x = getX(el);
-  var y = getY(el);
+  var coords = Position.cumulativeOffset(el);
+  var coords2 = Position.realOffset(el);
+  var x = coords[0];
+  var y = coords[1] - coords2[1] + (document.documentElement.scrollTop - 0 + 
document.body.scrollTop - 0);
   if(window.ActiveXObject) {
     dragel.style.height = (el.offsetHeight ? (el.offsetHeight) : 
el.displayHeight) + "px";
   }

Modified: 
xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/ajax/panelWizard.js
===================================================================
--- 
xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/ajax/panelWizard.js 
    2008-02-18 01:22:43 UTC (rev 7783)
+++ 
xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/ajax/panelWizard.js 
    2008-02-18 01:58:04 UTC (rev 7784)
@@ -104,8 +104,10 @@
   realParent = el.parentNode;
   parentNode = el.parentNode;
   var isAdded = (realParent != leftPanels && realParent != rightPanels);
-  var x = getX(el);
-  var y = getY(el);
+  var coords = Position.cumulativeOffset(el);
+  var coords2 = Position.realOffset(el);
+  var x = coords[0];
+  var y = coords[1] - coords2[1] + (document.documentElement.scrollTop - 0 + 
document.body.scrollTop - 0);
   if(window.ActiveXObject) {
     dragel.style.height = (el.offsetHeight ? (el.offsetHeight) : 
el.displayHeight) + "px";
   }

_______________________________________________
notifications mailing list
notifications@xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to