Last active
August 29, 2015 14:05
-
-
Save yoannmoinet/d2dfd2f5dd3be37140cc to your computer and use it in GitHub Desktop.
Events for a mobile/desktop Backbone application.
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
Backbone.MOBILE = navigator.userAgent.match(/mobile/i); | |
var View = Backbone.View.extend({ | |
events: function () { | |
return Backbone.MOBILE ? { | |
"click .new_message": "newMessageClick", | |
"touchstart #send_new_message": "openMenu", | |
"touchend #send_new_message": "selectMenu" | |
} : { | |
"click .new_message": "newMessageClick", | |
"mousedown #send_new_message": "openMenu", | |
"mouseup #send_new_message": "selectMenu" | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment