From bbd402fcffcaafbfff4629fc155aacc1566f1143 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Tue, 20 Apr 2010 23:51:18 -0700 Subject: [PATCH] Partial fix for HTML5 drag and drop with collection views. Reviewed by me. --- AppKit/CPCollectionView.j | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index cf91c32cd..10c017f23 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -590,6 +590,14 @@ - (void)mouseDragged:(CPEvent)anEvent { + var locationInWindow = [anEvent locationInWindow], + mouseDownLocationInWindow = [_mouseDownEvent locationInWindow]; + + // FIXME: This is because Safari's drag hysteresis is 3px x 3px + if ((ABS(locationInWindow.x - mouseDownLocationInWindow.x) < 3) && + (ABS(locationInWindow.y - mouseDownLocationInWindow.y) < 3)) + return; + if (![_delegate respondsToSelector:@selector(collectionView:dragTypesForItemsAtIndexes:)]) return;