Addepar/ember-table — pull request #51 by alexspeller (2013-05-16 17:38:47+00:00)
Title: Unbind resize event on willDestroyElement

The ResizeHandler is not working correctly when views are swapped in and out, as the order of calls to willDestroy is for some reason not what you'd expect. Below is the order of events. This patch the problem by unbinding the resize event in `willDestroyElement` instead of `willDestroy`

```
# Go to page route with resize aware view
didInsertElement in child view
didInsertElement in ResizeHandler
resize event fired

# Remove view by user action
willDestroyElement in child view
willDestroyElement in ResizeHandler
didInsertElement in ResizeHandler
willDestroy in child view
willDestroy in ResizeHandler

# Go back to view by user action
willDestroyElement in ResizeHandler
didInsertElement in child view
didInsertElement in ResizeHandler
willDestroy in ResizeHandler

# Now because willDestroy in ResizeHandler was called before didInsertElement in ResizeHandler, the resize handling stops working
```

I'm not entirely sure _why_ `willDestroy` is called in that order, but it just seems to work that way, perhaps because `willDestroy` is not a view callback method but is from a class further up the chain.