XF 2.0 Problems instantiating JS in 2.0.4 (worked in 2.0.3)

Jaxel

Well-known member
I have a JS activator on atendo-maxheight. Lets say this activator is on 34 different divs.

Code:
    EWRatendo.MaxHeight = XF.Element.newHandler(
    {
        $target: null,
        
        init: function()
        {
            $target = this.$target;
            $target.on('click', '.atendo-expand', $.proxy(this, 'expand'));
        },
        
        expand: function(e)
        {
            $target.height('auto');
            $target.find('.atendo-expand').hide();
        },
    });

In 2.0.3, this worked fine. It would activate on each div separately. When I click on .atendo-expand, it would expand on the correct of the 34 targets.

However, in 2.0.4, this no longer works correctly. No matter which .atendo-expand I click on, it now only expands the final of the 34 targets.

Any ideas on how to get this working on 2.0.4?
 
I've figured it out... In 2.0.4, in the proxied function, you must now use this. to access your handler variables. In 2.0.3, this was not required.
 
Well it shouldn’t have worked and there were no changes that would have made it stop working.
 
Interesting, you only need to use this on "click" proxies. It doesn't work properly on "change" proxies.
 
Back
Top Bottom