Closed mandx closed 11 years ago
How to tell which particular button is clicked?
@Dmitry-N-Medvedev Something like:
$('.open-toolbar-btn').toolbar({ /* toolbar options... */}).on('toolbarItemClick', function (event, button) {
/* `button` is the toolbar just clicked */
});
Very nice. Thanks a lot.
PS: ..and why is this not reflected in the documentation?
Thanks @mandx
I had the events outlined in the documentation provided in the zip file but hadn't made the change to the web based documentation. The web documentation has been updated. Thanks for picking this up.
@paulkinzett No problem!
toolbaritemclick
: Triggered when a button in the toolbar is clickedtoolbarshown
: Triggered when the toolbar is showntoolbarhidden
: Triggered when the toolbar is hiddenSome times is very handy to know when the toolbar is being shown/hidden. For instance, I use the toolbar to provide formatting options to an item, and then save the item's style to the server when the toolbar is closed.
The
toolbaritemclick
is handy when the toolbar content is generated (like providing raw HTML), and there is no DOM node to register for events.