<commit_before>import { Directive, Renderer2, ElementRef } from '@angular/core';
var jQuery = require("jquery");

@Directive({
  selector: '[scroller]'
})
export class TableScrollerDirective {
  private animSpeed: number = 15000;
  constructor(
    private renderer: Renderer2,
    private element: ElementRef
  ){

  }
  ngOnInit() {
    setTimeout(() => {
      var offset = parseInt(jQuery(this.element.nativeElement).find('table').height() / 40);
      this.startScrolling(offset);
    }, 10000)
  }

  startScrolling(offset) {
    setInterval(() => {
      jQuery(this.element.nativeElement).animate({
        scrollTop: jQuery(this.element.nativeElement).scrollTop() + offset
      }, 500);
    }, 10000)
  }
}<commit_msg>scroll table<commit_after>import { Directive, Renderer2, ElementRef } from '@angular/core';
var jQuery = require("jquery");

@Directive({
  selector: '[scroller]'
})
export class TableScrollerDirective {
  private animSpeed: number = 15000;
  private prevScrollOffset: number = -1;
  constructor(
    private renderer: Renderer2,
    private element: ElementRef
  ){

  }
  ngOnInit() {
    setTimeout(() => {
      var offset = parseInt(jQuery(this.element.nativeElement).find('table').height() / 40);
      this.startScrolling(offset);
    }, 10000)
  }

  startScrolling(offset) {
    setInterval(() => {

      let scrollTo = jQuery(this.element.nativeElement).scrollTop() + offset;

      if(this.prevScrollOffset == jQuery(this.element.nativeElement).scrollTop()) {
        scrollTo = 0;
      }

      jQuery(this.element.nativeElement).animate({
        scrollTop: scrollTo
      }, 500, () => {

      });


      setTimeout(() => {
        console.log(offset, jQuery(this.element.nativeElement).scrollTop(), jQuery(this.element.nativeElement).find('table').height())
      }, 800)
    }, 1000)
  }
}
{'fraction_non_alphanumeric': 0.1502449646162221, 'fraction_numerical': 0.0261295590636908, 'mean_word_length': 3.4611650485436893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3739705', 'n_tokens_mistral': 595, 'n_tokens_neox': 543, 'n_words': 101}