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

XenForo.register(), XenForo.activate() and $.context()...

Discussion in 'XenForo Development Discussions' started by Mr. Goodie2Shoes, Nov 12, 2014.

  1. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    So I am creating a prototype object to 'manage' my form and the code looks something like:
    MyObj.MyFunc = function($form) { this.__construct($form); };
    MyObj.MyFunc.prototype =
      __construct: function($form)
      XenForo.register($form.find('.steps'), $.context(this, 'bleh'));
      bleh: function($element)
    XenForo.Register('.StuffEditor', 'MyObj.MyFunc');
    The 'bleh' function only gets called after I added 'XenForo.activate($form)'.

    Anyways, the problem I am currently facing is that the log for 'console.log($element)' is returning 0.

    I am not good with javascript so be nice guys :p
  2. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    Upon investigating the arguments that were given while calling the 'bleh' function, I found that there are two args being passed, the first is 0 and the second one is the object that was supposed to be passed as the first variable... o_O

Share This Page