Changeset 1095
- Timestamp:
- 12/11/08 03:18:28 (8 months ago)
- Files:
-
- 1 modified
-
trunk/ui/ui.sortable.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.sortable.js
r1034 r1095 135 135 this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; 136 136 137 //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way 138 if(this.helper[0] != this.currentItem[0]) { 139 this.currentItem.hide(); 140 } 141 142 //Create the placeholder 143 this._createPlaceholder(); 144 137 145 //Set a containment if given in the options 138 146 if(o.containment) 139 147 this._setContainment(); 140 141 //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way142 if(this.helper[0] != this.currentItem[0]) {143 this.currentItem.hide();144 }145 146 //Create the placeholder147 this._createPlaceholder();148 148 149 149 //Call plugins and callbacks … … 703 703 0 - this.offset.relative.left - this.offset.parent.left, 704 704 0 - this.offset.relative.top - this.offset.parent.top, 705 $(o.containment == 'document' ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this. helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0),706 ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this. helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0)705 $(o.containment == 'document' ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0), 706 ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0) 707 707 ]; 708 708 … … 715 715 co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left, 716 716 co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top, 717 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.helperProportions.width- this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0),718 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.helperProportions.height- this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0)717 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), 718 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) 719 719 ]; 720 720 } … … 775 775 if(position.left < this.containment[0]) position.left = this.containment[0]; 776 776 if(position.top < this.containment[1]) position.top = this.containment[1]; 777 if(position.left > this.containment[2]) position.left = this.containment[2];778 if(position.top > this.containment[3]) position.top = this.containment[3];777 if(position.left + this.helperProportions.width > this.containment[2]) position.left = this.containment[2] - this.helperProportions.width; 778 if(position.top + this.helperProportions.height > this.containment[3]) position.top = this.containment[3] - this.helperProportions.height; 779 779 } 780 780