Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calculate_day(day_values){
- var sum = [].reduce.call(
- day_values.querySelectorAll('input.timer_input'),
- (res, node) => res + +(node.value || 0),
- 0
- );
- return sum
- }
- $('body').bind('onload change', '.timer_input', function() {
- $('.tab-content .table_index').each(function() {
- var sum = calculate_day(this);
- var id = $(this).find('.sum_total').text(sum).closest('.tab-pane').attr('id');
- $('a[href="#' + id + '"].sum_total').text(sum);
- });
- }).change();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement