Changes between Initial Version and Version 1 of Ticket #15039


Ignore:
Timestamp:
Sep 1, 2016, 4:36:48 PM (5 years ago)
Author:
Scott González
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15039

    • Property Summary changed from Dragging Sortable list items over items that are Display:None Lag to Sortable: Draggig list items over items that are display: none causes a lag
  • Ticket #15039 – Description

    initial v1  
    1 Theres a shit ton of lag when you try to drag items over items that have the property Display:none
     1Theres a lot of lag when you try to drag items over items that have the property Display:none
    22
    3 
    4 {{{
    5 refreshPositions: function( fast ) {
    6 
    7                 // Determine whether items are being displayed horizontally
    8                 this.floating = this.items.length ?
    9                         this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
    10                         false;
    11 
    12                 //This has to be redone because due to the item being moved out/into the offsetParent,
    13                 // the offsetParent's position will change
    14                 if ( this.offsetParent && this.helper ) {
    15                         this.offset.parent = this._getParentOffset();
    16                 }
    17 
    18                 var i, item, t, p;
    19 
    20                 for ( i = this.items.length - 1; i >= 0; i-- ) {
    21                         item = this.items[ i ];
    22 
    23                         //We ignore calculating positions of all connected containers when we're not over them
    24                         if ( item.instance !== this.currentContainer && this.currentContainer &&
    25                                         item.item[ 0 ] !== this.currentItem[ 0 ] ) {
    26                                 continue;
    27                         }
    28 
    29                         t = this.options.toleranceElement ?
    30                                 $( this.options.toleranceElement, item.item ) :
    31                                 item.item;
    32 
    33                         if (!fast) {
    34                                 if(item.item.css('display') === 'none') {
    35                                         item.width = 0;
    36                                         item.height = 0;
    37                                 }
    38                                 else {
    39                                         item.width = t.outerWidth();
    40                                         item.height = t.outerHeight();
    41                                 }
    42                         }
    43 
    44                         p = t.offset();
    45                         item.left = p.left;
    46                         item.top = p.top;
    47                 }
    48 }}}
    49 
     3EDIT: code snippet removed
    504
    515Here's the post revolving this issue: http://stackoverflow.com/questions/9440664/jquery-ui-sortable-drag-initiation-is-slow-when-container-has-hidden-items