Changeset 1326

Show
Ignore:
Timestamp:
12/30/08 07:05:09 (15 months ago)
Author:
paul.bakaus
Message:

sortable: merged draggable fixes into sortables (r1325,1313)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.sortable.js

    r1171 r1326  
    716716 
    717717                        this.containment = [ 
    718                                 co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left, 
    719                                 co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top, 
    720                                 co.left + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0), 
    721                                 co.top + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0) 
     718                                co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.margins.left, 
     719                                co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.margins.top, 
     720                                co.left + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.margins.left, 
     721                                co.top + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.margins.top 
    722722                        ]; 
    723723                } 
     
    989989                        i.offset.parent = i._getParentOffset(); 
    990990                } 
     991                 
     992                // This is another very weird special case that only happens for relative elements: 
     993                // 1. If the css position is relative 
     994                // 2. and the scroll parent is the document or similar to the offset parent 
     995                // we have to refresh the relative offset during the scroll so there are no jumps 
     996                if(scrolled !== false && i.cssPosition == 'relative' && !(i.scrollParent[0] != document && i.scrollParent[0] != i.offsetParent[0])) { 
     997                        i.offset.relative = i._getRelativeOffset(); 
     998                } 
    991999 
    9921000        }