Author: dmorozov
Date: 2008-07-30 09:41:26 -0400 (Wed, 30 Jul 2008)
New Revision: 9827
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
https://jira.jboss.org/jira/browse/RF-4019
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss
===================================================================
---
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss 2008-07-30
12:21:46 UTC (rev 9826)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss 2008-07-30
13:41:26 UTC (rev 9827)
@@ -50,9 +50,10 @@
.rich-dragindicator-iframe {
position: absolute;
display: block;
- z-index: 1;
+ z-index: 999;
top: 0px;
left: 0px;
+ filter:Alpha(opacity=0);
}
]]></f:verbatim>
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-07-30
12:21:46 UTC (rev 9826)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2008-07-30
13:41:26 UTC (rev 9827)
@@ -36,9 +36,7 @@
new Insertion.Top(this, parts.invoke('getContent', p).join(''));
- if (DragIndicator.isIE6) {
- this.initIFrame();
- }
+ this.adjustIFrame();
},
show: function() {
@@ -53,6 +51,8 @@
}
Element.show(this);
this.style.position = 'absolute';
+
+ this.adjustIFrame(true);
},
hide: function() {
@@ -69,6 +69,8 @@
}
this.floatedToBody = false;
}
+
+ this.adjustIFrame(false);
},
position: function(x, y) {
@@ -77,6 +79,8 @@
this.style.position = 'absolute';
}
Element.setStyle(this, {"left": x + "px", "top": y +
"px"});
+
+ this.moveIFrame(x, y);
},
accept: function() {
@@ -123,15 +127,44 @@
getRejectClass: function() {
return this.ils_rejectClass;
},
-
initIFrame: function() {
- var iframe = document.createElement("iframe");
- Element.addClassName(iframe, 'rich-dragindicator-iframe');
- this.insertBefore(iframe, this.firstChild);
- var table = iframe.nextSibling;
- iframe.style.width = table.offsetWidth + "px";
- iframe.style.height = table.offsetHeight + "px";
- }
+ 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');
+ }
+ },
+ moveIFrame: function(x, y) {
+ this.initIFrame();
+ if(this.iframe) {
+ Element.setStyle(this.iframe, {"left": x, "top": y});
+ }
+ },
+ adjustIFrame: function(show) {
+ this.initIFrame();
+
+ if(this.iframe)
+ {
+ if (Element.visible(this)) {
+ var w = this.offsetWidth + "px";
+ var h = this.offsetHeight + "px";
+ var x = this.offsetLeft + "px";
+ var y = this.offsetTop + "px";
+
+ Element.setStyle(this.iframe, {"left": x, "top": y});
+ Element.setStyle(this.iframe, {"width": w, "height": h});
+ }
+
+ if (arguments.length > 0) {
+ if (show) {
+ this.iframe.style.display = "block";
+ } else {
+ this.iframe.style.display = "none";
+ }
+ }
+ }
+ }
};
function createDragIndicator(elt, acceptClass, rejectClass) {