Author: sergeyhalipov
Date: 2007-12-19 09:02:26 -0500 (Wed, 19 Dec 2007)
New Revision: 4917
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
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
Log:
Drag and drop, some improvements.
http://jira.jboss.com/jira/browse/RF-1082
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 2007-12-19
12:49:19 UTC (rev 4916)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/css/dragIndicator.xcss 2007-12-19
14:02:26 UTC (rev 4917)
@@ -49,7 +49,7 @@
.rich-dragindicator-iframe {
position: absolute;
- display: none;
+ display: block;
z-index: 1;
top: 0px;
left: 0px;
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-19
12:49:19 UTC (rev 4916)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2007-12-19
14:02:26 UTC (rev 4917)
@@ -3,7 +3,7 @@
init: function(event) {
var ieVersion = RichFaces.getIEVersion();
if (ieVersion && ieVersion < 7) {
- DragIndicator.disableSelects = true;
+ DragIndicator.isIE6 = true;
}
},
@@ -38,7 +38,7 @@
new Insertion.Top(this, parts.invoke('getContent', p).join(''));
- if (DragIndicator.disableSelects) {
+ if (DragIndicator.isIE6) {
this.initIFrame();
}
},
@@ -114,13 +114,12 @@
},
initIFrame: function() {
- var iframe = this.firstChild;
- if (iframe && "iframe" == iframe.tagName.toLowerCase()) {
- iframe.style.display = "block";
- var table = iframe.nextSibling;
- iframe.style.width = table.offsetWidth + "px";
- iframe.style.height = table.offsetHeight + "px";
- }
+ 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";
}
};
@@ -147,11 +146,6 @@
// <div class="drgind_shadow" />
DefaultDragIndicatorView =
[
- new E('iframe',
- {
- 'className':'rich-dragindicator-iframe'
- }
- ),
new E('table',
{
'style':'height : 100%; z-index: 2;',
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
---
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-12-19
12:49:19 UTC (rev 4916)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-12-19
14:02:26 UTC (rev 4917)
@@ -67,12 +67,7 @@
initDrag: function(event) {
if (Event.isLeftClick(event)) {
var src = Event.element(event);
- if(src.tagName && (
- src.tagName.toUpperCase() == 'INPUT' ||
- src.tagName.toUpperCase() == 'SELECT' ||
- src.tagName.toUpperCase() == 'OPTION' ||
- src.tagName.toUpperCase() == 'BUTTON' ||
- src.tagName.toUpperCase() == 'TEXTAREA'))
+ if(src.tagName && /^INPUT|SELECT|OPTION|BUTTON|TEXTAREA$/i.test(src.tagName))
return;
Event.stop(event);