Skip to content

Instantly share code, notes, and snippets.

@sammyaxe
Created May 4, 2015 08:02
Show Gist options
  • Save sammyaxe/e2085e899df326007393 to your computer and use it in GitHub Desktop.
Save sammyaxe/e2085e899df326007393 to your computer and use it in GitHub Desktop.
eventEmitter.on('_panmove', function (e) {
var x = lastTranslate.x + e.deltaX,
y = lastTranslate.y + e.deltaY,
r = config.rotation(x, y, targetElement, config.maxRotation);
if(e.deltaX > 150 || e.deltaX < -150 ) card.throwOut(x, y);
config.transform(targetElement, x, y, r);
eventEmitter.trigger('dragmove', {
target: targetElement,
throwOutConfidence: config.throwOutConfidence(x, targetElement),
throwDirection: x < 0 ? Card.DIRECTION_LEFT : Card.DIRECTION_RIGHT
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment