flightjs/flight — pull request #189 by phuu (2013-10-22 16:39:39+00:00)
Title: Fix shared node event handler off bug.

Currently, in Flight, when you reuse a component multiple times, and those components all listen on one element (eg, document), when you this.off that event (in any of the component instances), it removes the handler for all the instances.

This means that tearing down any one of the repeated components, offs the events of the other instances, causing big problems.

This was becuase Flight was messing with guids to try to help jQuery figure out how to do $.off. As a result, it was modifying the one function that all instances of a particular component were referencing *and* the bound version of this function such that *all* bound copies of a function had the same guid.

jQuery uses the function's guid to figure out which event handlers to remove, so it was removing listeners that it shouldn't have been.

This was found because we repeat a column component in TweetDeck.

I didn't test, but I suspect this also affects different components that mix in the same mixin.

I put together a [test case that demonstrates this](https://github.com/phuu/flight-event-bug).