<commit_before>class window.SubchannelItemView extends Backbone.Marionette.ItemView
  tagName: "li"
  events:
    click: "clickHandler"
    "click .close": "destroySubchannel"

  template: "subchannels/_subchannel_item"
  initialize: ->
    @model.bind "destroy", @close, this

  destroySubchannel: (e) ->
    @model.destroy()  if confirm("Are you sure you want to remove this channel from your channel?")
    e.stopPropagation()
    false

  onRender: ->
    @$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')

  clickHandler: (e) ->
    return  if e.metaKey or e.ctrlKey or e.altKey
    mp_track "Channel: Click on subchannel",
      channel_id: currentChannel.id
      subchannel_id: @model.id

    Backbone.history.navigate @model.get("created_by").username + "/channels/" + @model.id, true
    e.preventDefault()
    false<commit_msg>Use defaultClickHandler to navigate to subChannel<commit_after>class window.SubchannelItemView extends Backbone.Marionette.ItemView
  tagName: "li"
  events:
    click: "clickHandler"
    "click .close": "destroySubchannel"

  template: "subchannels/_subchannel_item"
  initialize: ->
    @model.bind "destroy", @close, this

  destroySubchannel: (e) ->
    @model.destroy()  if confirm("Are you sure you want to remove this channel from your channel?")
    e.stopPropagation()
    false

  onRender: ->
    @$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')

  clickHandler: (e) ->
    mp_track "Channel: Click on subchannel",
      channel_id: currentChannel.id
      subchannel_id: @model.id

    @defaultClickHandler e
{'fraction_non_alphanumeric': 0.12829957028852057, 'fraction_numerical': 0.0, 'mean_word_length': 3.8511904761904763, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, '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': '6883131', 'n_tokens_mistral': 508, 'n_tokens_neox': 500, 'n_words': 126}