jQuery: The Write Less, Do More JavaScript Library

Changeset 4602

Show
Ignore:
Timestamp:
02/03/08 17:12:15 (7 months ago)
Author:
paul.bakaus
Message:

fixed comma issue, speeded up sortables a bit

Files:
1 modified

Legend:

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

    r4595 r4602  
    1616                    new $.ui.sortable(this, options); 
    1717            }); 
    18         }, 
     18        } 
    1919    }); 
    2020     
     
    143143 
    144144        }, 
    145         refreshPositions: function() { 
     145        refreshPositions: function(fast) { 
    146146            for (var i = this.items.length - 1; i >= 0; i--){ 
    147                 this.items[i].width = this.items[i].item.outerWidth(); 
    148                 this.items[i].height = this.items[i].item.outerHeight(); 
     147                if(!fast) this.items[i].width = this.items[i].item.outerWidth(); 
     148                if(!fast) this.items[i].height = this.items[i].item.outerHeight(); 
    149149                var p = this.items[i].item.offset(); 
    150150                this.items[i].left = p.left; 
     
    264264            //Rearrange 
    265265            for (var i = this.items.length - 1; i >= 0; i--) { 
    266                 if(this.intersectsWith(this.items[i]) && this.items[i].item[0] != this.currentItem[0] && !this.currentItem[0].contains(this.items[i].item[0])) { 
     266                if(this.intersectsWith(this.items[i]) && this.items[i].item[0] != this.currentItem[0] && (this.options.tree ? !this.currentItem[0].contains(this.items[i].item[0]) : true)) { 
    267267                    //Rearrange the DOM 
    268268                    this.items[i].item[this.direction == 'down' ? 'before' : 'after'](this.currentItem); 
    269                     this.refreshPositions(); //Precompute after each DOM insertion, NOT on mousemove 
     269                    this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove 
    270270                    if(this.placeholderElement) this.placeholder.css(this.placeholderElement.offset()); 
    271271                    this.propagate("change", e); //Call plugins and callbacks