simonexmachina / jquery-bonsai

Super lightweight jQuery tree plugin
http://simonwade.me/jquery-bonsai
MIT License
148 stars 42 forks source link

use event delegation #29

Open cancerberoSgx opened 8 years ago

cancerberoSgx commented 8 years ago

Nice project! but you should use event delegation for this to escalate for big trees. Instead of registering a mouse event per tree node, you should register only one event listener in the tree top-most-div and then use event.target to get the actual clicked node.

simonexmachina commented 8 years ago

Yes that's very true. Feel like doing a PR?

On Sat, 13 Aug 2016 at 8:48 AM, Sebastián Gurin notifications@github.com wrote:

Nice project! but you should use event delegation for this to escalate for big trees. Instead of registering a mouse event per tree node, you should register only one event listener in the tree top-most-div and then use event.target to get the actual clicked node.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aexmachina/jquery-bonsai/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP-rCH3MeQmE3MQ09DW8RCHqZa3VyS4ks5qfPg1gaJpZM4JjhQp .

cancerberoSgx commented 8 years ago

Not in the short term :(