<commit_before>define(function(require) {

  var $ = require('jquery');
  var _ = require('underscore');
  var Backbone = require('backbone');
  var EntriesView = require('views/entries');
  var EditorView = require('views/editor');
  var docs = require('collections/docs');
  var cache = require('utils/cache');
  var settings = require('models/settings');


  var isMac = /Mac/.test(navigator.platform);


  var AppView = Backbone.View.extend({

    el: 'body',

    initialize: function() {
      this.editor = new EditorView();
      this.entries = new EntriesView();

      this.$aside = this.$('aside');

      setTimeout(_.bind(function() {
        if ((docs.length > 2) && (editor.innerHTML != '')) {
          this.$aside.removeClass('visible');
        }
      }, this), 3000);

      docs.on('add', function() {
        if ((docs.length === 3) && (editor.innerHTML != '')) {
          this.$aside.removeClass('visible');
        }
      }, this);
    },

    events: {
      'click #aside': 'toggleAside',
      'click #add': 'newDoc',
      'click #menu-button': 'toggleAside',
      'keydown': 'handleKey'
    },

    newDoc: function(e) {
      e.preventDefault();

      if (!cache.openDoc.isEmpty()) {
        docs.addNew();
      } else {
        this.editor.focus();
      }
    },

    toggleAside:  function(e) {
      e.stopImmediatePropagation();<commit_msg>remove the faulty code I added before which leads the sidebar to never disappear, ref #60<commit_after>define(function(require) {

  var $ = require('jquery');
  var _ = require('underscore');
  var Backbone = require('backbone');
  var EntriesView = require('views/entries');
  var EditorView = require('views/editor');
  var docs = require('collections/docs');
  var cache = require('utils/cache');
  var settings = require('models/settings');


  var isMac = /Mac/.test(navigator.platform);


  var AppView = Backbone.View.extend({

    el: 'body',

    initialize: function() {
      this.editor = new EditorView();
      this.entries = new EntriesView();

      this.$aside = this.$('aside');

      setTimeout(_.bind(function() {
        if ((docs.length > 2)) {
          this.$aside.removeClass('visible');
        }
      }, this), 3000);

      docs.on('add', function() {
        if ((docs.length === 3)) {
          this.$aside.removeClass('visible');
        }
      }, this);
    },

    events: {
      'click #aside': 'toggleAside',
      'click #add': 'newDoc',
      'click #menu-button': 'toggleAside',
      'keydown': 'handleKey'
    },

    newDoc: function(e) {
      e.preventDefault();

      if (!cache.openDoc.isEmpty()) {
        docs.addNew();
      } else {
        this.editor.focus();
      }
    },

    toggleAside:  function(e) {
      e.stopImmediatePropagation();
{'fraction_non_alphanumeric': 0.17338129496402876, 'fraction_numerical': 0.005035971223021582, 'mean_word_length': 2.5745501285347046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5167519', 'n_tokens_mistral': 883, 'n_tokens_neox': 831, 'n_words': 172}