[richfaces-svn-commits] JBoss Rich Faces SVN: r5497 - in branches/3.1.x: ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Jan 21 11:30:20 EST 2008


Author: sergeyhalipov
Date: 2008-01-21 11:30:20 -0500 (Mon, 21 Jan 2008)
New Revision: 5497

Modified:
   branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
   branches/3.1.x/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
http://jira.jboss.com/jira/browse/RF-1625

Modified: branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js	2008-01-21 16:20:58 UTC (rev 5496)
+++ branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js	2008-01-21 16:30:20 UTC (rev 5497)
@@ -96,18 +96,22 @@
         if (!dragDiv) {        		
 	   		dragDiv = document.createElement("div");
 	        dragDiv.id = "_rfDefaultDragIndicatorLeft";
+	        Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
 	        document.body.appendChild(dragDiv);
+	        
 	        dragDiv = document.createElement("div");
 	        dragDiv.id = "_rfDefaultDragIndicatorRight";
+	        Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
 	        document.body.appendChild(dragDiv);
+	        
 	        dragDiv = document.createElement("div");
 	        dragDiv.id = "_rfDefaultDragIndicatorBottom";
-	        Element.setStyle(dragDiv, {"font-size" : "0px"});
+	        Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
 	        document.body.appendChild(dragDiv);
         	
             dragDiv = document.createElement("div");
             dragDiv.id = "_rfDefaultDragIndicator";
-            Element.setStyle(dragDiv, {"font-size" : "0px"});
+            Element.setStyle(dragDiv, {"font-size" : "0px", "zIndex": 1000});
             Object.extend(dragDiv, DefaultDragIndicator);            	
             document.body.appendChild(dragDiv);
         }

Modified: branches/3.1.x/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js	2008-01-21 16:20:58 UTC (rev 5496)
+++ branches/3.1.x/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js	2008-01-21 16:30:20 UTC (rev 5497)
@@ -36,6 +36,15 @@
 	},
 
 	show: function() {
+		if (!this.floatedToBody) {
+			if (!this.realParent) {
+				this.realParent = this.parentNode;
+				this._nextSibling = this.nextSibling;
+			}
+			this.realParent.removeChild(this);
+			document.body.appendChild(this);
+			this.floatedToBody = true;
+		}
 		Element.show(this);
 		this.style.position = 'absolute';
 	},
@@ -45,19 +54,24 @@
 		this.style.position = '';
 		this.offsets = undefined;
 		this.leave();
+		if (this.floatedToBody && this.realParent) {
+			document.body.removeChild(this);
+			if (this._nextSibling) {
+				this.realParent.insertBefore(this, this._nextSibling);
+			} else {
+				this.realParent.appendChild(this);
+			}
+			this.floatedToBody = false;
+		}
 	},
 
 	position: function(x, y) {
 		if (!this.offsets) {
 			Element.show(this);
 			this.style.position = 'absolute';
-
-			this.offsets = Position.cumulativeOffset(this);
-			this.offsets[0] -= this.offsetLeft || 0;
-			this.offsets[1] -= this.offsetTop || 0;
 		}		
 
-		Element.setStyle(this, {"left": - this.offsets[0] + x + "px", "top": - this.offsets[1] + y + "px"});
+		Element.setStyle(this, {"left": x + "px", "top": y + "px"});
 	},
 
 	accept: function() {




More information about the richfaces-svn-commits mailing list