Last active
March 30, 2016 15:14
-
-
Save askehansen/b152f9d907ffb140f7a5fcc78e136601 to your computer and use it in GitHub Desktop.
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
$(document).on('click', '@stepper-up, @stepper-down', function() { | |
var sender = $(this); | |
var parent = sender.parents('@stepper'); | |
var target = parent.find('@stepper-input'); | |
var val = parseInt(target.val()); | |
if (sender.is('@stepper-up')) { | |
val++; | |
} | |
else { | |
val--; | |
} | |
target.val(val); | |
parent.trigger('stepper:changed', val); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment