XF 2.1 Expanding Signatures

I want users signatures to have a default max-height of 150px, but, when the user clicks the signature element I want it to expand to a max-height of 800px. To do that I tried editing message-macro with the changes below, but, it doesn't seem to do anything. Anyone know what I did wrong?

SignatureExpandHelp.webp
 
It would seem I can not edit my original post. So here's an accidental bump. So, recently we discovered a way to make it kind of work. By using doing this:

CSS:
.message-signature.expanded-signature
{
    max-height: none;
}

and then this inside helper_js_global:

JavaScript:
<xf:js>
    $(function () {
    'use strict';

    $('.message-signature').click(function () {
        if ($(this).hasClass('expanded-signature'))
            $(this).removeClass('expanded-signature');
        else
            $(this).addClass('expanded-signature');
    });
});
</xf:js>

The only issue is many of our users use spoiler buttons inside their signatures and click the button (because it rests inside message-signature) will deploy the code and change the max height of the signature. So then I tried this:

JavaScript:
<xf:js>
    $(function () {
    "use strict";
   
    $(".message-signature").click(function () {
        if ($(this).hasClass("expanded-signature"))
            $(this).removeClass("expanded-signature");
        else
            $(this).addClass("expanded-signature");
        $('.bbCodeSpoiler').click(function(e) {e.stopPropagation();})
    });
});
</xf:js>

which technically works, it doesn't expand or collapse the signature when clicking on a spoiler... but, it also breaks spoiler buttons all across the site. So this doesn't work either...

Anyone have ideas to adjust the code to get it to work?
 
Top Bottom