<commit_before>class ActiveAdmin.TableCheckboxToggler extends ActiveAdmin.CheckboxToggler
  _init: ->
    super

  _bind: ->
    super

    @$container.find('tbody td').click (e)=>
      @_didClickCell(e.target) if e.target.type isnt 'checkbox'

  _didChangeCheckbox: (checkbox) ->
    super

    $row = $(checkbox).parents 'tr'

    if checkbox.checked
      $row.addClass 'selected'
    else
      $row.removeClass 'selected'

  _didChangeToggleAllCheckbox: ->
    checked = super

    if checked
      @$container.find('tbody tr').addClass 'selected'
    else
      @$container.find('tbody tr').removeClass 'selected'

  _didClickCell: (cell) ->
    $(cell).parent('tr').find(':checkbox').click()

$.widget.bridge 'tableCheckboxToggler', ActiveAdmin.TableCheckboxToggler<commit_msg>Use jQuery's toggleClass method<commit_after>class ActiveAdmin.TableCheckboxToggler extends ActiveAdmin.CheckboxToggler
  _init: ->
    super

  _bind: ->
    super

    @$container.find('tbody td').click (e)=>
      @_didClickCell(e.target) if e.target.type isnt 'checkbox'

  _didChangeCheckbox: (checkbox) ->
    super

    $(checkbox).parents('tr').toggleClass 'selected', checkbox.checked

  _didChangeToggleAllCheckbox: ->
    @$container.find('tbody tr').toggleClass 'selected', super

  _didClickCell: (cell) ->
    $(cell).parent('tr').find(':checkbox').click()

$.widget.bridge 'tableCheckboxToggler', ActiveAdmin.TableCheckboxToggler
{'fraction_non_alphanumeric': 0.13925822253324002, 'fraction_numerical': 0.0, 'mean_word_length': 3.9825783972125435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5327043', 'n_tokens_mistral': 458, 'n_tokens_neox': 442, 'n_words': 82}