Vladislav Rastrusny
Active member
This works ok:
But this doesn't:
EditorInit is executed, I can see that by placing alert(1) before XenForo.register, but the registration itself doesn't work. It doesn't register editor plugin.
EditorInit even needed in cases like with XenMediaGallery, where editor HTML code is loaded by Ajax later after DOM is complete.
PHP:
XenForo.register('textarea.BbCodeWysiwygEditor', 'XenForo.CustomEditorForMyAddon');
});
But this doesn't:
PHP:
$(document).on('EditorInit', function (e, data) {
XenForo.register('textarea.BbCodeWysiwygEditor', 'XenForo.CustomEditorForMyAddon');
});
EditorInit even needed in cases like with XenMediaGallery, where editor HTML code is loaded by Ajax later after DOM is complete.