Last active
December 12, 2015 05:29
-
-
Save rikukissa/4722505 to your computer and use it in GitHub Desktop.
Knockout binding handlers for jquery.events.swipe plugin
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
swipeEvents = ['swipeleft', 'swiperight', 'swipeup', 'swipedown'] | |
for e in swipeEvents | |
do (e) -> | |
ko.bindingHandlers[e] = | |
init: (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) -> | |
f = valueAccessor() | |
$(element).on e, -> f.apply viewModel, [e] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment