<commit_before>import React, { Component } from 'react';
import CodebookDatatable from './Codebook_Datatable';
import CodebookSidebar from './Codebook_Sidebar';
import { Container, Row, Col, Modal, ModalBody, Spinner } from 'reactstrap';
import CodebookFilterModal from './Codebook_Filter_Search';
import axios from 'axios';

export default class Codebook extends Component {
    constructor(props) {
        super(props);
        this.state = {
            selected: null,
            loader: false,
            filterData: null
        };

        this.setSelected = this.setSelected.bind(this);
        this.filterData = this.filterData.bind(this);
    }

    componentDidMount() {
        this.showLoader();
        this.getFirstChildItem();
    }

    setSelected(childItem) {
        this.setState({<commit_msg>Forced page to scroll to top on load<commit_after>import React, { Component } from 'react';
import CodebookDatatable from './Codebook_Datatable';
import CodebookSidebar from './Codebook_Sidebar';
import { Container, Row, Col, Modal, ModalBody, Spinner } from 'reactstrap';
import CodebookFilterModal from './Codebook_Filter_Search';
import axios from 'axios';
import $ from 'jquery';

export default class Codebook extends Component {
    constructor(props) {
        super(props);
        this.state = {
            selected: null,
            loader: false,
            filterData: null
        };

        this.setSelected = this.setSelected.bind(this);
        this.filterData = this.filterData.bind(this);
        this.scrollToAnchor = this.scrollToAnchor.bind(this);
    }

    componentDidMount() {
        this.showLoader();
        this.getFirstChildItem();
        this.scrollToAnchor('content-scoda', 'html,body', true);
    }

    scrollToAnchor(id, scrollElement, animate){
        // Set the anchor
        var to = $('#' + id);
        // Animate or jump scrollElement to anchor point
        if (animate) {
          $(scrollElement).animate({scrollTop: to.offset().top},'fast');
        } else {
          $(scrollElement).scrollTop(to.offset().top);
        }
        console.log('scroll function run')
      }

    setSelected(childItem) {
        this.setState({
{'fraction_non_alphanumeric': 0.11596180081855388, 'fraction_numerical': 0.0, 'mean_word_length': 2.741496598639456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5005522', 'n_tokens_mistral': 610, 'n_tokens_neox': 601, 'n_words': 147}