Bug Tracker

Changeset 5384

Show
Ignore:
Timestamp:
05/02/08 16:02:40 (8 months ago)
Author:
paul.bakaus
Message:
 
Files:
1 modified

Legend:

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

    r5383 r5384  
    5151            this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element); 
    5252            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"); 
    5354 
    5455            /* 
     
    8485            this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size 
    8586 
     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 
    8694 
    8795            /* 
     
    93101                if(o.containment == 'parent') o.containment = this.helper[0].parentNode; 
    94102                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)) { 
    96104                    var ce = $(o.containment)[0]; 
    97105                    var co = $(o.containment).offset(); 
     
    100108                        co.left + parseInt($(ce).css("borderLeftWidth"),10) - this.offset.relative.left - this.offset.parent.left, 
    101109                        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("borderRightWidth"),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("borderBottomWidth"),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) 
    104112                    ]; 
    105113                }