1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Call to XenForo.register doesn't work being called on event

Discussion in 'XenForo Development Discussions' started by Vladislav Rastrusny, Jul 5, 2014.

  1. Vladislav Rastrusny

    Vladislav Rastrusny Active Member

    This works ok:
    PHP:
    XenForo.register('textarea.BbCodeWysiwygEditor''XenForo.CustomEditorForMyAddon');
      });
    But this doesn't:
    PHP:
      $(document).on('EditorInit', function (edata) {
      
    XenForo.register('textarea.BbCodeWysiwygEditor''XenForo.CustomEditorForMyAddon');
      });
    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.
     
  2. Vladislav Rastrusny

    Vladislav Rastrusny Active Member

    Addition: this was about Javascript ;) I'm trying to create editor button, that will work in all cases.
     

Share This Page