Created
March 9, 2016 13:37
-
-
Save xarimanx/02a7eb51efdd66ecc4a2 to your computer and use it in GitHub Desktop.
emulate drag&drop
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
triggerMousemove = (x, y, target)-> | |
triggerEvent({ pageX: x, pageY: y, target: target }, "mousemove") | |
triggerMousedown = (target)-> | |
triggerEvent({ target: target }, "mousedown") | |
triggerMouseup = -> | |
triggerEvent({}, "mouseup") | |
triggerEvent = (props, name)-> | |
e = $.Event(name) | |
e = _.extend e, props | |
$(document).trigger(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment