[richfaces-svn-commits] JBoss Rich Faces SVN: r4972 - trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Dec 22 07:21:07 EST 2007


Author: sergeyhalipov
Date: 2007-12-22 07:21:07 -0500 (Sat, 22 Dec 2007)
New Revision: 4972

Modified:
   trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
http://jira.jboss.com/jira/browse/RF-1625

Modified: trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
===================================================================
--- trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js	2007-12-22 11:56:40 UTC (rev 4971)
+++ trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js	2007-12-22 12:21:07 UTC (rev 4972)
@@ -1,10 +1,13 @@
 DragIndicator = {
 
     init: function(event) {
-    	var ieVersion = RichFaces.getIEVersion();
-    	if (ieVersion && ieVersion < 7) {
-			DragIndicator.isIE6 = true;
-		}
+    	DragIndicator.isIE = (RichFaces.MSIE == RichFaces.navigatorType());
+    	if (DragIndicator.isIE) {
+	    	var ieVersion = RichFaces.getIEVersion();
+	    	if (ieVersion && ieVersion < 7) {
+				DragIndicator.isIE6 = true;
+			}
+    	}
     },
 
     setContent: function(name, single, params) {
@@ -44,6 +47,14 @@
 	},
 
 	show: function() {
+		if (DragIndicator.isIE && !this.floatedToBody) {
+			if (!this.realParent) {
+				this.realParent = this.parentNode;
+			}
+			this.realParent.removeChild(this);
+			document.body.appendChild(this);
+			this.floatedToBody = true;
+		}
 		Element.show(this);
 		this.style.position = 'absolute';
 	},
@@ -53,6 +64,11 @@
 		this.style.position = '';
 		this.offsets = undefined;
 		this.leave();
+		if (DragIndicator.isIE && this.floatedToBody && this.realParent) {
+			document.body.removeChild(this);
+			this.realParent.appendChild(this);
+			this.floatedToBody = false;
+		}
 	},
 
 	position: function(x, y) {
@@ -60,11 +76,14 @@
 			Element.show(this);
 			this.style.position = 'absolute';
 
-			this.offsets = Position.cumulativeOffset(this);
-			this.offsets[0] -= this.offsetLeft || 0;
-			this.offsets[1] -= this.offsetTop || 0;
+			if (!DragIndicator.isIE) {
+				this.offsets = Position.cumulativeOffset(this);
+				this.offsets[0] -= this.offsetLeft || 0;
+				this.offsets[1] -= this.offsetTop || 0;
+			} else {
+				this.offsets = [0, 0];
+			}
 		}		
-
 		Element.setStyle(this, {"left": - this.offsets[0] + x + "px", "top": - this.offsets[1] + y + "px"});
 	},
 




More information about the richfaces-svn-commits mailing list