paulkinzett / toolbar

A tooltip style toolbar jQuery plugin
http://paulkinzett.github.com/toolbar/
MIT License
2.3k stars 321 forks source link

Better handling of the `hideOnClick` option #12

Closed mandx closed 11 years ago

mandx commented 11 years ago

If having multiple toolbars on the same page, all with the option hideOnClick enabled, opening a second toolbar doesn't hide the first opened toolbar. And when clicking everywhere else, only the last toolbar is hidden.

This commit fixes both issues by registering once to the $('html') 'click' event, and better checking of when to hide the toolbar.