<commit_before>class App.TrashView extends Backbone.View
  events:
    'dragstart':        'start'
    'dragenter .trash': 'enter'
    'dragleave .trash': 'leave'
    'drop      .trash': 'trash'
    'drop':             'drop'

  render: ->
    @$el.append JST.trash()
    @trash = @el.querySelector '.trash'
    @trash.style.display = 'none'
    App.Dnd.install @trash, ['postit', 'line']
    @

  start: (e) ->
    e = e.originalEvent if e.originalEvent
    classes = e.target.classList
    unless classes.contains 'resize' or classes.contains 'corner'
      @trash.style.display = 'block'
    true

  enter: ->
    @trash.classList.add 'hover'
    true

  leave: ->
    @trash.classList.remove 'hover'
    true

  trash: (e) ->
    e = e.originalEvent if e.originalEvent
    [type, cid] = App.Dnd.get e
    if type == "text/line"
      collection = @model.lines
    else if type == "text/postit"
      collection = @model.postits
    else
      return true
    if el = collection.getByCid cid
      el.destroy()
    e.preventDefault()
    false

  drop: (e) ->
    @trash.style.display = 'none'
    @trash.classList.remove 'hover'
    true
<commit_msg>Fix trash<commit_after>class App.TrashView extends Backbone.View
  events:
    'dragstart':        'start'
    'dragenter .trash': 'enter'
    'dragleave .trash': 'leave'
    'drop      .trash': 'trash'
    'drop':             'drop'

  render: ->
    @$el.append JST.trash()
    @trash = @el.querySelector '.trash'
    @trash.style.display = 'none'
    App.Dnd.install @trash, ['postit', 'line']
    @

  start: (e) ->
    e = e.originalEvent if e.originalEvent
    classes = e.target.classList
    unless classes.contains 'resize' or classes.contains 'corner'
      @trash.style.display = 'block'
    true

  enter: ->
    @trash.classList.add 'hover'
    true

  leave: ->
    @trash.classList.remove 'hover'
    true

  trash: (e) ->
    e = e.originalEvent if e.originalEvent
    [type, cid] = App.Dnd.get e
    if type == "text/koalab-line"
      collection = @model.lines
    else if type == "text/koalab-postit"
      collection = @model.postits
    else
      return true
    if el = collection.getByCid cid
      el.destroy()
    e.preventDefault()
    false

  drop: (e) ->
    @trash.style.display = 'none'
    @trash.classList.remove 'hover'
    true

{'fraction_non_alphanumeric': 0.13977566867989646, 'fraction_numerical': 0.0, 'mean_word_length': 2.3034188034188032, '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': '2454724', 'n_tokens_mistral': 818, 'n_tokens_neox': 819, 'n_words': 187}