diff options
-rwxr-xr-x | framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js index 107269f2..efec6a69 100755 --- a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js @@ -22,12 +22,36 @@ Object.extend(Prado.WebUI.DropContainer.prototype, {
var elementId=dragElement.id.replace(/clone_/,"");
var req = new Prado.CallbackRequest(this.options.EventTarget, this.options);
+ var curleft = curtop = 0;
+ var obj = dropElement;
+ if (obj.offsetParent) {
+ curleft = obj.offsetLeft
+ curtop = obj.offsetTop
+ while (obj = obj.offsetParent) {
+ curleft += obj.offsetLeft
+ curtop += obj.offsetTop
+ }
+ }
+ var scrOfX = 0, scrOfY = 0;
+ if( typeof( window.pageYOffset ) == 'number' ) {
+ //Netscape compliant
+ scrOfY = window.pageYOffset;
+ scrOfX = window.pageXOffset;
+ } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
+ //DOM compliant
+ scrOfY = document.body.scrollTop;
+ scrOfX = document.body.scrollLeft;
+ } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
+ //IE6 standards compliant mode
+ scrOfY = document.documentElement.scrollTop;
+ scrOfX = document.documentElement.scrollLeft;
+ }
req.setCallbackParameter({
DragElementID : elementId,
ScreenX : event.screenX,
ScreenY : event.screenY,
- OffsetX : event.offsetX,
- OffsetY : event.offsetY,
+ OffsetX : event.offsetX || event.clientX - curleft + scrOfX,
+ OffsetY : event.offsetY || event.clientY - curtop + scrOfY,
ClientX : event.clientX,
ClientY : event.clientY,
AltKey : event.altKey,
|