Created
May 1, 2014 18:14
-
-
Save JBKahn/250a28288c309fa61bef to your computer and use it in GitHub Desktop.
Drag & Drop Attempt 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getDirectionMoved: (e, collectionLength, mousePos, spacerHeight) => | |
spacerOffsetTop = @$spacer.offset().top | |
isOnTopOfSpacer = mousePos > spacerOffsetTop and mousePos < spacerOffsetTop + spacerHeight | |
isAboveSpacer = mousePos < spacerOffsetTop | |
isBelowSpacer = not isAboveSpacer and not isOnTopOfSpacer | |
spacerIsAtTop = Data.FinancialTransactions.dragCurrentIndex is 0 | |
spacerIsAtBottom = Data.FinancialTransactions.dragCurrentIndex is collectionLength | |
return 'above' if isAboveSpacer and not spacerIsAtTop #and isOnTopOfTable | |
return 'below' if isBelowSpacer and not spacerIsAtBottom #and isOnTopOfTable | |
return 'none' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment