Skip to main content

Search and Top Navigation

#1683 closed bug (fixed)

Opened September 19, 2007 05:27PM UTC

Closed September 23, 2007 01:36PM UTC

Last modified February 26, 2009 11:06AM UTC

Sortable slow with long lists (partial fix included)

Reported by: sqrrrl Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

Dragging sortables with long lists is slow. There is a significant lag when the lists get to be > 50 items. I found one very quick fix, which at least addresses sorting near the top half of the list.

In drag, simply breaking the loop once an overlapping element is found speeds things up dramatically. I added breaks as shown...

				if(overlap >= 0 && overlap <= 0.5) { //Overlapping at top
					ci.prev().length ? ma(this.element) : mb(this.element);
                    break;
				}

				if(overlap < 0 && overlap > -0.5) { //Overlapping at bottom
					ci.next()[0] == this.element ? mb(this.element) : ma(this.element);
                    break;
				}

Another possibility, which I haven't tried yet, is to track element positions during drag so we check for overlaps with the closest elements first rather than restarting at the top of the list each time.

Attachments (0)
Change History (5)

Changed September 19, 2007 11:37PM UTC by sqrrrl comment:1

BTW - See ticket #1680 for modified version that contains several performance fixes.

Changed September 23, 2007 12:15PM UTC by paul comment:2

owner: → paul
status: newassigned

Changed September 23, 2007 01:36PM UTC by paul comment:3

resolution: → fixed
status: assignedclosed

Added the breaks! I'm investigating more speed fixes.

Changed May 24, 2008 03:39AM UTC by comment:4

milestone: 1.2.1

Milestone 1.2.1 deleted

Changed February 26, 2009 11:06AM UTC by paul comment:5

milestone: → 1.5