<commit_before>/*!
 * scrolling.js
 *
 * Copyright © 2016 <NAME> | MIT license
 * http://j-pel.github.io/dynamize
 * 
 */

(function() {

  'use strict';

  var elements = document.getElementsByClassName('scrollable');
  for (var i = 0; i < elements.length; i++) {
    var table = elements[i];
    elements[i].tHead.classList.add('fix-top');
    var page = table.parentNode;
    var scroller = document.createElement("div");
    page.insertBefore(scroller,table)
    page.removeChild(table);
    scroller.style.display = "block";
    ["position","width","height","maxWidth","maxHeight","minWidth","minHeight",
    "top","left","bottom","right"].forEach(function(prop){
      scroller.style[prop] = table.style[prop];
    });
    ["movable","rotable","sizable"].forEach(function(cls){
			if(table.classList.contains(cls)) {
				scroller.classList.add(cls);
				table.classList.remove(cls);
			}
		});
    table.style.width = "100%";
    scroller.style.overflow = "scroll";
    scroller.appendChild(table);
  }

  var elements = document.getElementsByClassName('fix-top');
  for (var i = elements.length-1; elements.length > 0;i = elements.length-1) {
    var table = elements[i].parentNode;
    var head = elements[i].cloneNode(true);
    head.classList.remove('fix-top');
    var fixed = table.parentNode.insertBefore(document.createElement("table"),table);
    fixed.classList.add('top-fixed');
    fixed.appendChild(head);
    fixed.style.position = "sticky";
    fixed.style.top = "0px";
    fixed.style.width = "100%";
    table.removeChild(elements[i]);
  }
  window.addEventListener('resize', onResize, false);
  onResize();

  function onResize() {
    var elements = document.getElementsByClassName('top-fixed');
    for (var e = 0; e < elements.length; e++) {
      var head = elements[e].tHead.rows[0].cells;
      var body = elements[e].nextSibling.tBodies[0]
      if (body.rows.length==0) return(0);
      body = body.rows[0].cells;
      for (var i=0;i<body.length;i++) {
        head[i].style.minWidth = body[i].clientWidth + "px";<commit_msg>Fix: bug in scrolling.js header position<commit_after>/*!
 * scrolling.js
 *
 * Copyright © 2016 <NAME> | MIT license
 * http://j-pel.github.io/dynamize
 * 
 */

(function() {

  'use strict';

  var elements = document.getElementsByClassName('scrollable');
  for (var i = 0; i < elements.length; i++) {
    var table = elements[i];
    var thead = elements[i].tHead;
    var page = table.parentNode;
    var header = document.createElement("div");
    var headert = document.createElement("table");
    var scroller = document.createElement("div");
    thead.classList.add('top-fixed');
    table.removeChild(thead);
    page.insertBefore(header,table);
    header.appendChild(headert);
    headert.appendChild(thead);
    page.insertBefore(scroller,table);
    page.removeChild(table);
    scroller.style.display = "block";
    ["position","width","height","maxWidth","maxHeight","minWidth","minHeight",
    "top","left","bottom","right"].forEach(function(prop){
      scroller.style[prop] = table.style[prop];
    });
    ["movable","rotable","sizable"].forEach(function(cls){
			if(table.classList.contains(cls)) {
				scroller.classList.add(cls);
				table.classList.remove(cls);
			}
		});
    table.style.width = "100%";
    scroller.style.overflow = "scroll";
    scroller.appendChild(table);
  }

  var elements = document.getElementsByClassName('fix-top');
  for (var i = elements.length-1; elements.length > 0;i = elements.length-1) {
    var table = elements[i].parentNode;
    var head = elements[i].cloneNode(true);
    table.removeChild(thead);
    var theadt = document.createElement("table");
    theadt.appendChild(thead);
    head.classList.remove('fix-top');
    var fixed = table.parentNode.insertBefore(document.createElement("table"),table);
    fixed.classList.add('top-fixed');
    fixed.appendChild(head);
    fixed.style.position = "sticky";
    fixed.style.top = "0px";
    fixed.style.width = "100%";
    table.removeChild(elements[i]);
  }
  window.addEventListener('resize', onResize, false);
  onResize();

  function onResize() {
    var elements = document.getElementsByClassName('top-fixed');
    for (var e = 0; e < elements.length; e++) {
      var head = elements[e].rows[0].cells;
      var body = elements[e].parentNode.parentNode.nextSibling.firstChild.tBodies[0]
      if (body.rows.length==0) return(0);
      body = body.rows[0].cells;
      for (var i=0;i<body.length;i++) {
        head[i].style.minWidth = body[i].clientWidth + "px";
{'fraction_non_alphanumeric': 0.1738651388276774, 'fraction_numerical': 0.009695901278096077, 'mean_word_length': 3.8082627118644066, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '2072381', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1452, 'n_words': 244}