Opened 5 years ago

Last modified 5 years ago

#15039 new bug

Dragging Sortable list items over items that are Display:None Lag — at Initial Version

Reported by: Karan Kotwal Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:

Description

Theres a shit ton of lag when you try to drag items over items that have the property Display:none

refreshPositions: function( fast ) {

		// Determine whether items are being displayed horizontally
		this.floating = this.items.length ?
			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
			false;

		//This has to be redone because due to the item being moved out/into the offsetParent,
		// the offsetParent's position will change
		if ( this.offsetParent && this.helper ) {
			this.offset.parent = this._getParentOffset();
		}

		var i, item, t, p;

		for ( i = this.items.length - 1; i >= 0; i-- ) {
			item = this.items[ i ];

			//We ignore calculating positions of all connected containers when we're not over them
			if ( item.instance !== this.currentContainer && this.currentContainer &&
					item.item[ 0 ] !== this.currentItem[ 0 ] ) {
				continue;
			}

			t = this.options.toleranceElement ?
				$( this.options.toleranceElement, item.item ) :
				item.item;

			if (!fast) {
				if(item.item.css('display') === 'none') {
					item.width = 0;
					item.height = 0;
				}
				else {
					item.width = t.outerWidth();
					item.height = t.outerHeight();
				}
			}

			p = t.offset();
			item.left = p.left;
			item.top = p.top;
		}

Here's the post revolving this issue: http://stackoverflow.com/questions/9440664/jquery-ui-sortable-drag-initiation-is-slow-when-container-has-hidden-items

Change History (0)

Note: See TracTickets for help on using tickets.