diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-07 22:56:56 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-07 22:56:56 +0000 |
commit | 47e04b888dbc6cdc99ebf37461a08a7c53d5bc49 (patch) | |
tree | 698fedec0077bca9782d948f80a240659996ebe9 /ui/ui.draggable.js | |
parent | 030ca01d4dd76ba7785fb084f238f2627dbcf732 (diff) | |
download | jquery-ui-47e04b888dbc6cdc99ebf37461a08a7c53d5bc49.tar.gz jquery-ui-47e04b888dbc6cdc99ebf37461a08a7c53d5bc49.zip |
draggable: fixed cursorAt issue (#2965)
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r-- | ui/ui.draggable.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 692cf20d5..8e670244b 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -71,6 +71,7 @@ $.widget("ui.draggable", $.extend($.ui.mouse, { }; this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position + if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix this.offset.parent = { //Store its position plus border top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) @@ -86,10 +87,10 @@ $.widget("ui.draggable", $.extend($.ui.mouse, { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size if(o.cursorAt) { - if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left; - if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right; - if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top; - if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom; + if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left + this.margins.left; + if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right + this.margins.left; + if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top + this.margins.top; + if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom + this.margins.top; } |