Mr. Goodie2Shoes
Well-known member
So I am creating a prototype object to 'manage' my form and the code looks something like:
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
Code:
MyObj.MyFunc = function($form) { this.__construct($form); };
MyObj.MyFunc.prototype =
{
__construct: function($form)
{
console.log('bleh');
XenForo.register($form.find('.steps'), $.context(this, 'bleh'));
XenForo.activate($form);
},
bleh: function($element)
{
console.log('yolo');
console.log($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