[richfaces-svn-commits] JBoss Rich Faces SVN: r5015 - 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
Wed Dec 26 11:58:53 EST 2007
Author: sergeyhalipov
Date: 2007-12-26 11:58:53 -0500 (Wed, 26 Dec 2007)
New Revision: 5015
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-26 16:42:59 UTC (rev 5014)
+++ trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2007-12-26 16:58:53 UTC (rev 5015)
@@ -1,13 +1,8 @@
DragIndicator = {
init: function(event) {
- DragIndicator.isIE = (RichFaces.MSIE == RichFaces.navigatorType());
- if (DragIndicator.isIE) {
- var ieVersion = RichFaces.getIEVersion();
- if (ieVersion && ieVersion < 7) {
- DragIndicator.isIE6 = true;
- }
- }
+ var ieVersion = RichFaces.getIEVersion();
+ DragIndicator.isIE6 = (ieVersion && ieVersion < 7);
},
setContent: function(name, single, params) {
@@ -47,9 +42,10 @@
},
show: function() {
- if (DragIndicator.isIE && !this.floatedToBody) {
+ if (!this.floatedToBody) {
if (!this.realParent) {
this.realParent = this.parentNode;
+ this._nextSibling = this.nextSibling;
}
this.realParent.removeChild(this);
document.body.appendChild(this);
@@ -64,9 +60,13 @@
this.style.position = '';
this.offsets = undefined;
this.leave();
- if (DragIndicator.isIE && this.floatedToBody && this.realParent) {
+ if (this.floatedToBody && this.realParent) {
document.body.removeChild(this);
- this.realParent.appendChild(this);
+ if (this._nextSibling) {
+ this.realParent.insertBefore(this, this._nextSibling);
+ } else {
+ this.realParent.appendChild(this);
+ }
this.floatedToBody = false;
}
},
@@ -75,16 +75,8 @@
if (!this.offsets) {
Element.show(this);
this.style.position = 'absolute';
-
- 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"});
+ Element.setStyle(this, {"left": x + "px", "top": y + "px"});
},
accept: function() {
More information about the richfaces-svn-commits
mailing list