You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2007/03/07 15:31:49 UTC
svn commit: r515607 -
/incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js
Author: mturyn
Date: Wed Mar 7 07:31:48 2007
New Revision: 515607
URL: http://svn.apache.org/viewvc?view=rev&rev=515607
Log:
WARNING: Alters dojo.dnd.HtmlDragObject.prototype.onDragMove
Added code to patch Dojo 0.3 dragging; still not perfect under IE6, but better there and works well under Firefox.
Modified:
incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js
Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js?view=diff&rev=515607&r1=515606&r2=515607
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/Window.js Wed Mar 7 07:31:48 2007
@@ -514,4 +514,33 @@
r.style.left = (width-1)+"px";
br.style.left = (width-1)+"px";
}
-}
\ No newline at end of file
+}
+
+
+/**
+ * Patch for Dojo 0.3 bug: objects within
+ * divs other than the body are offset from the
+ * cursor by their immediate parent's top corner
+ * vector from body.topLeft. It looks like this
+ * parentPosition offset has been in and out of
+ * the code repeatedly.
+**/
+dojo.dnd.HtmlDragObject.prototype.onDragMove = function(e){
+ this.updateDragOffset();
+ var x = this.dragOffset.x + e.pageX;
+ var y = this.dragOffset.y + e.pageY;
+//********* Begin change from Dojo 0.3 original. ******************
+ x -= this.parentPosition.x ;
+ y -= this.parentPosition.y ;
+//*********** End change from Dojo 0.3 original. ******************
+
+ if (this.constrainToContainer) {
+ if (x < this.constraints.minX) { x = this.constraints.minX; }
+ if (y < this.constraints.minY) { y = this.constraints.minY; }
+ if (x > this.constraints.maxX) { x = this.constraints.maxX; }
+ if (y > this.constraints.maxY) { y = this.constraints.maxY; }
+ }
+
+ if(!this.disableY) { this.dragClone.style.top = y + "px"; }
+ if(!this.disableX) { this.dragClone.style.left = x + "px"; }
+}