<commit_before>
const Marionette = require('backbone.marionette');

module.exports = class NotificationBadgeView extends Marionette.View {
  template = Templates['nav/notification-badge'];

  modelEvents() {
    return {
      'reset': 'render'
    };
  }

  events() {
    return {
      'click': 'onClick'
    };
  }

  className() {
    const classes = ['badge'];
    const importance = this.model.greatestImportance();
    if(importance != null) classes.push(`${importance}-importance`);
    return classes.join(' ');
  }

  onRender() {
    this.$el.attr('class', this.className());
  }

  onClick() {
    window.app.displayEvents();
  }

  serializeData() {
    return {
      number: this.model.length,
      any: this.model.length > 0<commit_msg>Update notification badge in all circumstances<commit_after>
const Marionette = require('backbone.marionette');

module.exports = class NotificationBadgeView extends Marionette.View {
  template = Templates['nav/notification-badge'];

  modelEvents() {
    return {
      'reset add remove': 'render'
    };
  }

  events() {
    return {
      'click': 'onClick'
    };
  }

  className() {
    const classes = ['badge'];
    const importance = this.model.greatestImportance();
    if(importance != null) classes.push(`${importance}-importance`);
    return classes.join(' ');
  }

  onRender() {
    this.$el.attr('class', this.className());
  }

  onClick() {
    window.app.displayEvents();
  }

  serializeData() {
    return {
      number: this.model.length,
      any: this.model.length > 0
{'fraction_non_alphanumeric': 0.15335051546391754, 'fraction_numerical': 0.001288659793814433, 'mean_word_length': 3.1084656084656084, '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': '2640772', 'n_tokens_mistral': 497, 'n_tokens_neox': 475, 'n_words': 92}