tap/app/assets/javascripts/increment.js
2015-09-25 17:11:26 +02:00

12 lines
355 B
JavaScript

ready = function() {
increment_function = function() {
target = $(this).data("target");
$(target).val(parseIntNaN($(target).data("default")) + parseIntNaN($(this).val()));
}
$('[data-increment]').change(increment_function);
$('[data-increment]').keyup(increment_function);
}
$(document).ready(ready);
$(document).on('page:load', ready);