<commit_before>exercism.views.SelectFilter = Backbone.View.extend({
  el: $('#pending-submissions'),

  events: {
    "click #filter-nits": "nitHandler",
    "click #filter-opinions": "opinionHandler",
  },

  initialize: function(options) {
    this.listenTo(this.model, "change", this.render);
  },

  filterNits: function () {
    this.$('div[data-nits][data-nits!=0]').toggle(!this.model.get("nits"));
  },

  filterOpinions: function () {
    this.$('div[data-opinions][data-opinions!=1]').toggle(!this.model.get("opinions"));
  },

  showAll: function () {
    this.$('.pending-submission').show();
  },

  render: function () {
    this.showAll();
    this.filterNits();
    this.filterOpinions();
  },

  nitHandler: function (event) {
    this.model.set("nits", $(event.currentTarget).is(':checked'));
  },

  opinionHandler: function (event) {
    this.model.set("opinions", $(event.currentTarget).is(':checked'));
  },
});

<commit_msg>Fix filter bug on nits<commit_after>exercism.views.SelectFilter = Backbone.View.extend({
  el: $('#pending-submissions'),

  events: {
    "click #filter-nits": "nitHandler",
    "click #filter-opinions": "opinionHandler",
  },

  initialize: function(options) {
    this.listenTo(this.model, "change", this.render);
  },

  filterNits: function () {
    if (this.model.get('nits')) { this.$('div[data-nits][data-nits!=0]').hide(); }
  },

  filterOpinions: function () {
    if (this.model.get('opinions')) { this.$('div[data-opinions][data-opinions!=1]').hide(); }
  },

  showAll: function () {
    this.$('.pending-submission').show();
  },

  render: function () {
    this.showAll();
    this.filterNits();
    this.filterOpinions();
  },

  nitHandler: function (event) {
    this.model.set("nits", $(event.currentTarget).is(':checked'));
  },

  opinionHandler: function (event) {
    this.model.set("opinions", $(event.currentTarget).is(':checked'));
  },
});


{'fraction_non_alphanumeric': 0.215962441314554, 'fraction_numerical': 0.0020865936358894104, 'mean_word_length': 3.981818181818182, 'pattern_counts': {'":': 4, '<': 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': '7574053', 'n_tokens_mistral': 682, 'n_tokens_neox': 648, 'n_words': 88}