Changeset 1096
- Timestamp:
- 12/11/08 05:39:15 (9 months ago)
- Location:
- trunk/ui
- Files:
-
- 2 modified
-
ui.draggable.js (modified) (3 diffs)
-
ui.sortable.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.draggable.js
r1023 r1096 263 263 if(!pos) pos = this.position; 264 264 var mod = d == "absolute" ? 1 : -1; 265 var scroll = this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'], scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); 265 266 266 267 return { … … 269 270 + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent 270 271 + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) 271 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'].scrollTop() ) * mod272 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod 272 273 + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) 273 274 ), … … 276 277 + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent 277 278 + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) 278 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'].scrollLeft() ) * mod279 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) * mod 279 280 + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) 280 281 ) -
trunk/ui/ui.sortable.js
r1095 r1096 726 726 if(!pos) pos = this.position; 727 727 var mod = d == "absolute" ? 1 : -1; 728 var scroll = this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'], scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); 728 729 729 730 return { … … 732 733 + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent 733 734 + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) 734 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'].scrollTop() ) * mod735 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod 735 736 + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) 736 737 ), … … 739 740 + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent 740 741 + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) 741 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : this[(this.cssPosition == 'absolute' ? 'offset' : 'scroll')+'Parent'].scrollLeft() ) * mod742 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) * mod 742 743 + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) 743 744 ) … … 762 763 - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent 763 764 - this.offset.parent.left // The offsetParent's offset without borders (offset + border) 764 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )765 + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) 765 766 ) 766 767 }; … … 940 941 $.ui.plugin.add("sortable", "scroll", { 941 942 start: function(event, ui) { 942 var o = ui.options; 943 var i = $(this).data("sortable"); 944 943 var i = $(this).data("sortable"), o = i.options; 945 944 if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); 946 947 }, 948 drag: function(event, ui) { 949 950 var o = ui.options, scrolled = false; 951 var i = $(this).data("sortable"); 945 }, 946 sort: function(event, ui) { 947 948 var i = $(this).data("sortable"), o = i.options, scrolled = false; 952 949 953 950 if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { … … 977 974 } 978 975 979 if(scrolled !== false && $.ui.ddmanager )976 if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) 980 977 $.ui.ddmanager.prepareOffsets(i, event); 981 978