<commit_before>import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import Settings from '/logic/core/settings';
import Util from '/views/canvas/ui/util';

import './canvas.html';
import './preloader';
import './markdown';

// Import History later because it depends on the canvas template
import History from '/views/history/history';

Template.canvas.onCreated(function () {
  this.subscribe('sections');
});

// Canvas.js is dedicated to managing canvas events.
// This includes how the canvas/off-canvas elements open/close and relate.
const Canvas = {
  /**
   * @summary Remove Overlay
   * @method
   */
  removeOverlay: () => {
    // Canvas element
    const canvas = document.querySelector('#canvas');

    // Prevent body scrolling
    document.body.classList.remove('noScroll');

    // Open canvas
    canvas.dataset.canvasState = '';
  },

  /**
   * @summary Close sidebars
   * @method
   */
  closeSidebars: () => {
    // Get all sidebars and links that happen to be open
    const sidebars = document.querySelectorAll('.sidebar[aria-hidden="false"]');
    const links = document.querySelectorAll('a[data-toggle="canvas"][aria-expanded="true"]');

    // Close all sidebars
    for (let i = 0; i < sidebars.length; i += 1) Util.hide(sidebars[i]);

    // Reset links
    for (let i = 0; i < links.length; i += 1) {
      Util.makeActive(links[i], false);
      links[i].removeEventListener('click', Canvas.handleCloseButton);
    }
<commit_msg>Fixed new bug created from history change<commit_after>import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import Settings from '/logic/core/settings';
import Util from '/views/canvas/ui/util';

import './canvas.html';
import './preloader';
import './markdown';

// Import History later because it depends on the canvas template
import History from '/views/history/history';

Template.canvas.onCreated(function () {
  this.subscribe('sections');
});

// Canvas.js is dedicated to managing canvas events.
// This includes how the canvas/off-canvas elements open/close and relate.
const Canvas = {
  /**
   * @summary Remove Overlay
   * @method
   */
  removeOverlay: () => {
    // Canvas element
    const canvas = document.querySelector('#canvas');

    // Prevent body scrolling
    document.body.classList.remove('noScroll');

    // Open canvas
    if (canvas) canvas.dataset.canvasState = '';
  },

  /**
   * @summary Close sidebars
   * @method
   */
  closeSidebars: () => {
    // Get all sidebars and links that happen to be open
    const sidebars = document.querySelectorAll('.sidebar[aria-hidden="false"]');
    const links = document.querySelectorAll('a[data-toggle="canvas"][aria-expanded="true"]');

    // Close all sidebars
    for (let i = 0; i < sidebars.length; i += 1) Util.hide(sidebars[i]);

    // Reset links
    for (let i = 0; i < links.length; i += 1) {
      Util.makeActive(links[i], false);
      links[i].removeEventListener('click', Canvas.handleCloseButton);
    }

{'fraction_non_alphanumeric': 0.14653465346534653, 'fraction_numerical': 0.0026402640264026403, 'mean_word_length': 3.386396526772793, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1270476', 'n_tokens_mistral': 901, 'n_tokens_neox': 878, 'n_words': 248}