codecombat/treema — pull request #21 by gintau (2014-03-24 22:06:41+00:00)
Title: Refeactor lastSelectedTreema methods.

This pull request is for keyboard navigation issues mentioned [here](https://github.com/codecombat/codecombat/pull/642).

Though I can fix it without change treema by calling toggleSelected() twice, there's a obvious latency on every clicks since the method walks through all nodes to see if they have last-selected class.

Here I add some functions for CodeCombat to directly manipulate the last selected node and avoid searching the whole treema on every clicks.