<commit_before># Copied from https://github.com/Addepar/ember-table/blob/master/src/utils/resize_handler.coffee
# Modified to use shared debounce helper
# Reduced default resize end delay property

#= require ../helpers/function_helpers

Emberella = window.Emberella
jQuery = window.jQuery
$ = jQuery unless $

# The resize handler will fire onWindowResize when the window resize ends
Ember.ResizeHandler = Ember.Mixin.create

  # Time in ms to debounce before triggering resizeEnd
  resizeEndDelay: 100
  resizing: no

  # This hook allows you to do any preparation to the view prior to any DOM
  # resize
  onResizeStart:  Ember.K
  # This hook allows you to clean up any sizing preparation
  onResizeEnd:    Ember.K
  # This hook allows you to listen to the window resizing
  onResize:       Ember.K

  # A debounced function to trigger the resizeEnd event. This is necessary
  # because we only want to fire resizeEnd if we have not received recent
  # resize event
  debounceResizeEnd: Ember.computed ->
    Emberella.debounce (event) =>
      return if @isDestroyed
      @set 'resizing', no
      @onResizeEnd?(event)
    , @get('resizeEndDelay')
  .property('resizeEndDelay')

  # A resize handler that binds handleWindowResize to this view
  resizeHandler: Ember.computed ->
    jQuery.proxy(@handleWindowResize, @)
  .property()

  # Browser only allows us to listen to windows resize. This function let us
  # resizeStart and resizeEnd event
  handleWindowResize: (event) ->
    if not @get 'resizing'
      @set 'resizing', yes
      @onResizeStart?(event)
    @onResize?(event)
    @get('debounceResizeEnd')(event)

  didInsertElement: ->
    @_super()
    $(window).bind 'resize', @get("resizeHandler")

  willDestroy: ->
    $(window).unbind 'resize', @get("resizeHandler")
    @_super()
<commit_msg>fix resize handler mixin to namespace resize event to prevent removal of all handlers when one view is destroyed<commit_after># Copied from https://github.com/Addepar/ember-table/blob/master/src/utils/resize_handler.coffee
# Modified to use shared debounce helper
# Reduced default resize end delay property

#= require ../helpers/function_helpers

Emberella = window.Emberella
jQuery = window.jQuery
$ = jQuery unless $

# The resize handler will fire onWindowResize when the window resize ends
Ember.ResizeHandler = Ember.Mixin.create

  # Time in ms to debounce before triggering resizeEnd
  resizeEndDelay: 100
  resizing: no

  # This hook allows you to do any preparation to the view prior to any DOM
  # resize
  onResizeStart:  Ember.K
  # This hook allows you to clean up any sizing preparation
  onResizeEnd:    Ember.K
  # This hook allows you to listen to the window resizing
  onResize:       Ember.K

  # A debounced function to trigger the resizeEnd event. This is necessary
  # because we only want to fire resizeEnd if we have not received recent
  # resize event
  debounceResizeEnd: Ember.computed ->
    Emberella.debounce (event) =>
      return if @isDestroyed
      @set 'resizing', no
      @onResizeEnd?(event)
    , @get('resizeEndDelay')
  .property('resizeEndDelay')

  # A resize handler that binds handleWindowResize to this view
  resizeHandler: Ember.computed ->
    jQuery.proxy(@handleWindowResize, @)
  .property()

  # Browser only allows us to listen to windows resize. This function let us
  # resizeStart and resizeEnd event
  handleWindowResize: (event) ->
    if not @get 'resizing'
      @set 'resizing', yes
      @onResizeStart?(event)
    @onResize?(event)
    @get('debounceResizeEnd')(event)

  didInsertElement: ->
    @_super()
    $(window).on 'resize.' + Ember.guidFor(@), @get("resizeHandler")

  willDestroy: ->
    $(window).off 'resize.' + Ember.guidFor(@), @get("resizeHandler")
    @_super()

{'fraction_non_alphanumeric': 0.089798087141339, 'fraction_numerical': 0.001594048884165781, 'mean_word_length': 3.712140175219024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '5623106', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1116, 'n_words': 384}