Changeset 4602
- Timestamp:
- 02/03/08 17:12:15 (7 months ago)
- Files:
-
- 1 modified
-
trunk/ui/ui.sortable.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.sortable.js
r4595 r4602 16 16 new $.ui.sortable(this, options); 17 17 }); 18 } ,18 } 19 19 }); 20 20 … … 143 143 144 144 }, 145 refreshPositions: function( ) {145 refreshPositions: function(fast) { 146 146 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(); 149 149 var p = this.items[i].item.offset(); 150 150 this.items[i].left = p.left; … … 264 264 //Rearrange 265 265 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)) { 267 267 //Rearrange the DOM 268 268 this.items[i].item[this.direction == 'down' ? 'before' : 'after'](this.currentItem); 269 this.refreshPositions( ); //Precompute after each DOM insertion, NOT on mousemove269 this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove 270 270 if(this.placeholderElement) this.placeholder.css(this.placeholderElement.offset()); 271 271 this.propagate("change", e); //Call plugins and callbacks