Siropu
Well-known member
I'm using this code:
It works fine in Chrome but in Firefox, I get this error: TypeError: ed.api is undefined
If I use
Is there a way to fix the issue in FF or is there a better way to listen to editor's focus/blur events?
JavaScript:
<script>
$(function()
{
var ed = $('textarea.BbCodeWysiwygEditor').data('XenForo.BbCodeWysiwygEditor');
if (ed && ed.api.isMobile())
{
ed.api.$editor.on('focus', function()
{
// do something
});
ed.api.$editor.on('blur', function()
{
// do something
});
}
});
</script>
It works fine in Chrome but in Firefox, I get this error: TypeError: ed.api is undefined
If I use
console.log(ed);
I can see the api object.Is there a way to fix the issue in FF or is there a better way to listen to editor's focus/blur events?