Changeset 5384
- Timestamp:
- 05/02/08 16:02:40 (8 months ago)
- Files:
-
- 1 modified
-
trunk/ui/ui.draggable.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.draggable.js
r5383 r5384 51 51 this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element); 52 52 if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); 53 if(!this.helper.css("position") || this.helper.css("position") == "static") this.helper.css("position", "absolute"); 53 54 54 55 /* … … 84 85 this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size 85 86 87 if(o.cursorAt) { 88 if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left; 89 if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right; 90 if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top; 91 if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom; 92 } 93 86 94 87 95 /* … … 93 101 if(o.containment == 'parent') o.containment = this.helper[0].parentNode; 94 102 if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)]; 95 if(!(/ (document|window|parent)/).test(o.containment)) {103 if(!(/^(document|window|parent)$/).test(o.containment)) { 96 104 var ce = $(o.containment)[0]; 97 105 var co = $(o.containment).offset(); … … 100 108 co.left + parseInt($(ce).css("borderLeftWidth"),10) - this.offset.relative.left - this.offset.parent.left, 101 109 co.top + parseInt($(ce).css("borderTopWidth"),10) - this.offset.relative.top - this.offset.parent.top, 102 co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - parseInt($(ce).css("border RightWidth"),10) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - parseInt(this.element.css("marginLeft") || 0,10) - parseInt(this.element.css("marginRight") || 0,10),103 co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - parseInt($(ce).css("border BottomWidth"),10) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - parseInt(this.element.css("marginTop") || 0,10) - parseInt(this.element.css("marginTop") || 0,10)110 co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - parseInt($(ce).css("borderLeftWidth"),10) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - parseInt(this.element.css("marginLeft") || 0,10) - parseInt(this.element.css("marginRight") || 0,10), 111 co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - parseInt($(ce).css("borderTopWidth"),10) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - parseInt(this.element.css("marginTop") || 0,10) - parseInt(this.element.css("marginTop") || 0,10) 104 112 ]; 105 113 }
