<commit_before>App.FilterSelectorComponent = Ember.Component.extend

  options: Ember.computed.alias('model.options')
  selectedOptions: Ember.computed.alias('model.selectedOptions')
  validOptions: Ember.computed.alias('model.validOptions')

  didInsertElement: ->
    Ember.$('body').on 'click', (evt) =>
      if @get('isOpen') && !($.contains(@get('element'), evt.target))
          @set('isOpen', false)
  selectedList: (->
    @get('selectedOptions').mapBy('displayName').join(', ')
  ).property('selectedOptions')

  isOpen: false

  actions:
    reset: ->
      @get('model').reset()
    select: (option) ->
      @get('model').addSelect(option)
    unselect: (option) ->
      @get('model').removeSelect(option)
    toggleOpen: ->
      @toggleProperty('isOpen')<commit_msg>Listen for events on document, not 'body'<commit_after>App.FilterSelectorComponent = Ember.Component.extend

  options: Ember.computed.alias('model.options')
  selectedOptions: Ember.computed.alias('model.selectedOptions')
  validOptions: Ember.computed.alias('model.validOptions')

  didInsertElement: ->
    Ember.$(document).on 'click', (evt) =>
      if @get('isOpen') && !($.contains(@get('element'), evt.target))
          @set('isOpen', false)
  selectedList: (->
    @get('selectedOptions').mapBy('displayName').join(', ')
  ).property('selectedOptions')

  isOpen: false

  actions:
    reset: ->
      @get('model').reset()
    select: (option) ->
      @get('model').addSelect(option)
    unselect: (option) ->
      @get('model').removeSelect(option)
    toggleOpen: ->
      @toggleProperty('isOpen')
{'fraction_non_alphanumeric': 0.18609022556390978, 'fraction_numerical': 0.0, 'mean_word_length': 4.037854889589905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '365671', 'n_tokens_mistral': 500, 'n_tokens_neox': 495, 'n_words': 73}