Author: dmorozov
Date: 2008-08-26 11:08:59 -0400 (Tue, 26 Aug 2008)
New Revision: 10193
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
https://jira.jboss.org/jira/browse/RF-4213
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 2008-08-26
14:25:35 UTC (rev 10192)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2008-08-26
15:08:59 UTC (rev 10193)
@@ -3,6 +3,8 @@
init: function(event) {
var ieVersion = RichFaces.getIEVersion();
DragIndicator.isIE6 = (ieVersion && ieVersion < 7);
+ this.realParent = this.parentNode;
+ this._nextSibling = this.nextSibling;
},
setContent: function(name, single, params) {
@@ -47,11 +49,6 @@
}
this.realParent.removeChild(this);
- if (this.iframe) {
- this.realParent.removeChild(this.iframe);
- document.body.appendChild(this.iframe);
- }
-
document.body.appendChild(this);
this.floatedToBody = true;
}
@@ -59,6 +56,11 @@
this.style.position = 'absolute';
this.adjustIFrame(true);
+ if (this.iframe) {
+ this.realParent.removeChild(this.iframe);
+ document.body.appendChild(this.iframe);
+ Element.show(this.iframe);
+ }
},
hide: function() {
@@ -75,15 +77,15 @@
this.realParent.appendChild(this);
}
- if (this.iframe) {
- document.body.removeChild(this.iframe);
- this.realParent.insertBefore(this.iframe, this);
- }
-
this.floatedToBody = false;
}
this.adjustIFrame(false);
+ if (this.iframe) {
+ Element.hide(this.iframe);
+ document.body.removeChild(this.iframe);
+ this.realParent.appendChild(this.iframe);
+ }
},
position: function(x, y) {
@@ -142,10 +144,11 @@
},
initIFrame: function() {
if (DragIndicator.isIE6 && !this.iframe) {
- new Insertion.Before(this,
- "<iframe src=\"javascript:''\" frameborder=\"0\"
scrolling=\"no\" id=\"" + this.id + "iframe\"" +
- "style=\"display: none;\"
class=\"rich-dragindicator-iframe\">" + "</iframe>");
- this.iframe = $(this.id + 'iframe');
+ var fakeElement = $(document.createElement("div"));
+ fakeElement.innerHTML = '<iframe class=\"rich-dragindicator-iframe\"
src="" scrolling="no" frameborder="0"
style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:block"></iframe>';
+ this.iframe = $(fakeElement.getElementsByTagName("iframe")[0]);
+ fakeElement.removeChild(this.iframe);
+ this.realParent.appendChild(this.iframe);
}
},
moveIFrame: function(x, y) {