Closed photostu closed 10 years ago
I did find a work-around and perhaps this is the appropriate method currently, but what I did was get the element that the toolbar is attached to, then discover the 'toobarObj' object in the data property and call hide() off of that.
If there is a better way, I'm all ears, but this seems to work.
Just started using this script and jquery, but for me this worked:
$('.myToolbarButton').on('toolbarItemClick', function(event) { $(this).trigger('click'); });
bora77 that code definitely works thank you. photostu I wish I could follow your method, I checked into the data property of the toolbar item itself and I get an undefined value. If you can share your codes I will definitely check them out.
But I think using the jQuery .trigger() method is easier because it's forcing the browser to recognize the click event and then naturally hide the menu. Also you can examine the clicked object data by using the console.dir() method which I just found on Stack.
$('#toolbar-btn').on('toolbarItemClick', function(event){
console.dir(event);
$(this).trigger('click');
});
Sorry if this is mentioned somewhere that I haven't read yet, but I can show my toolbars and have added dynamic click handlers for each of the icons, yet, how do you close the toolbar when an icon is clicked?
Thanks for your contribution!