mbraak / jqTree

Tree widget for jQuery
https://mbraak.github.io/jqTree/
Apache License 2.0
1.02k stars 177 forks source link

Toggle Open/Close from the label element and not folder icon. #182

Closed m3kilpat closed 11 years ago

m3kilpat commented 11 years ago

There is currently no way to toggle the folders opening/closing when clicking on the label element. It only works when clicking the folder's icon tag with the class of 'jqtree-toggler'.

I threw together a hack that satisfies my purposes, but this probably isn't the best way.

Add the following right before the if ($button.length) { (line1383) of the JqTreeWidget.prototype._click function:

// Hack to open/close the tree when the folder label is clicked instead of just the icon if (!$button.length){ $button = $target.closest('.jqtree-element'); }

mbraak commented 11 years ago

I think this can also be achieved by using the example code in issue 61.

m3kilpat commented 11 years ago

Awesome. That solution worked and I will go with it. Sorry about the duplicate.