function repeat()

in src/chart.js [1065:1105]


      function repeat() {
        if (animation == 'on') {            

          animation_duration = (params.yearMax - params.yearMin) * 500;
          this_chart.transition()
          .duration(animation_duration)
          .tween('year',tweenYear)
          .ease(d3.easeLinear)
          .on('end',function(){
            if (globals.trial_index > -1 && globals.num_selected == globals.trials[globals.trial_index].num_responses){
              d3.select('#progress_indicator').style('display','none');
              d3.select('#done_btn').attr('class','img_btn_enabled')
              .style('display',null)
              .attr('disabled',null)
              .attr('src', 'assets/done.svg');
            }
            else {
              d3.select('#submit_btn').attr('class','menu_btn_enabled')
              .attr('disabled',null);
            }
            loop_count++;
            if (!introduction_complete && globals.num_selected == 3) {              
              d3.select('#progress_indicator').style('display','none');
              d3.select('#done_btn').attr('class','img_btn_enabled')
              .style('display',null)
              .attr('disabled',null)
              .attr('src', 'assets/done.svg');
            }
            else {
              if (introduction_complete && loop_count > 0 && globals.num_selected == globals.trials[globals.trial_index].num_responses){
                d3.select('#done_btn').attr('class','img_btn_enabled')
                .attr('src', 'assets/done.svg');
              }
            }
            repeat();
          });
        }
        else {
          displayYear(current_year);
        }         
      }