Bug Tracker

Changeset 5144

Show
Ignore:
Timestamp:
03/31/08 02:22:00 (9 months ago)
Author:
braeker
Message:

Draggable - fixed #2343

Location:
trunk/ui
Files:
2 modified

Legend:

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

    r5143 r5144  
    3838    $.ui.plugin.add("draggable", "revert", { 
    3939        stop: function(e, ui) { 
    40             var self = ui.instance; 
     40            var self = ui.instance, helper = $(self.helper); 
    4141            self.cancelHelperRemoval = true; 
     42             
    4243            $(ui.helper).animate({ left: self.originalPosition.left, top: self.originalPosition.top }, parseInt(ui.options.revert, 10) || 500, function() { 
    43                 if(ui.options.helper != 'original') self.helper.remove(); 
    44                 self.clear(); 
     44                if(ui.options.helper != 'original') helper.remove(); 
     45                if (!helper) self.clear(); 
    4546            }); 
    4647        } 
  • trunk/ui/ui.draggable.js

    r5143 r5144  
    133133        }, 
    134134        start: function(e) { 
    135              
    136135            var o = this.options; 
    137136            if($.ui.ddmanager) $.ui.ddmanager.current = this; 
     
    141140            if(this.helper[0] != this.element[0]) this.helper.css('position', 'absolute'); 
    142141            if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); 
    143  
     142             
     143             
    144144            //Find out the next positioned parent 
    145145            this.offsetParent = (function(cp) { 
     
    230230            this.checkConstrains(); 
    231231             
    232             this.helper.css({ left: this.position.left+'px', top: this.position.top+'px' }); // Stick the helper to the cursor 
     232            $(this.helper).css({ left: this.position.left+'px', top: this.position.top+'px' }); // Stick the helper to the cursor 
    233233            if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); 
    234234            return false;