I'm using this editor: http://xing.github.com/wysihtml5/examples/simple.html (live demo).
You can assign custom functions to events:
"events": {
"focus": function() {
//my event
}
},
I added a custom button:
"font-styles": function(locale, options) {
return "<li>" +
"<a class='btn btn-paragraph' data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='p'>" + locale.font_styles.p + "</a>" +
"</li>";
}
So, I want to trigger the button on focus (textarea):
"events": {
"focus": function() {
$('.btn-paragraph').trigger('click');
}
},
But nothing happens, not even errors in the console. The strange thing is that I tried this:
"events": {
"focus": function() {
$('.btn-paragraph').hide();
}
},
And the button hid as soon as I focus my cursor in the textarea.
What I am missing here?