codecombat / treema

jQuery plugin that generates HTML interfaces to edit JSON data defined by json-schema.
http://codecombat.github.io/treema/
MIT License
152 stars 36 forks source link

Refeactor lastSelectedTreema methods. #21

Closed gintau closed 10 years ago

gintau commented 10 years ago

This pull request is for keyboard navigation issues mentioned here.

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.

sderickson commented 10 years ago

Nice! Yeah that should be faster.