praekelt/vumi-go — pull request #575 by justinvdm (2013-08-02 16:50:19+00:00)
Title: ConfirmView doens't unbind its events correctly

`Backbone.View.prototype.remove()` invokes `.stopListening()` and removes its element, but doesn't invoke it's `.off()` to unbind events bound using `.on()`. This is sensible behaviour, since listeners should be using `listenTo()`, and `.on()` should be used internally by the view instance itself.

Currently, we use `.on()` for `ConfirmView` events, since this allows us to unbind both `cancel` and `ok` events after one of them is triggered. We either need to find a way to use `listenTo()`, and still only have `cancel` and `ok` events behave as they currently do (the preferable approach), or have `ConfirmView.prototype.remove()` invoke its `.off()`.