symbiote/silverstripe-memberprofiles

Reference to non-existent jquery.js from silverstripe/admin

oddnoc opened this issue · 2 comments

oddnoc commented

silverstripe/admin no longer provides jquery.js

Requirements::javascript("silverstripe/admin: thirdparty/jquery/jquery.js");

Blocking the jQuery at all, and replace the password switch with something like:

const showClick = document.getElementsByClassName('showOnClick')[0]
const container = document.getElementsByClassName('showOnClickContainer')[0];
export default function() {
    if (showClick) {
        const link = showClick.querySelectorAll('a')[0];
        if (link) {
            link.addEventListener('click', function(e) {
                e.preventDefault();
                let classes = container.classList;
                if (classes.contains('d-none')) {
                    classes.remove('d-none');
                } else {
                    classes.add('d-none');
                }
            });
        }
    }
}

Fixes the whole jquery problem alltogether.

The script, IMO, is not worth requiring a library. It's a simple show/hide.