Last active
June 14, 2016 15:09
-
-
Save yuheiy/5e0572e2989e8faf23e240df81afb6eb to your computer and use it in GitHub Desktop.
for sp
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
'use strict'; | |
var hasTouchEvents = 'ontouchend' in document; | |
var type = hasTouchEvents ? 'touchend' : 'click'; | |
var onClick = function (target, listener) { | |
target.addEventListener(type, listener, false); | |
}; | |
export default onClick; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment