/** global: django */

window.onload = function() {
    if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') {
        (function($) {
            // add colopicker to inlines added dynamically
            $(document).on('formset:added', function onFormsetAdded(event, row) {
                jscolor.installByClassName('jscolor');
            });
        })(django.jQuery);
    }
};
/** global: django */

window.addEventListener('load', (event) => {
    if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') {
        (function($) {
            // add colopicker to inlines added dynamically
            $(document).on('formset:added', function onFormsetAdded(event, row) {
                jscolor.installByClassName('jscolor');
            });
        })(django.jQuery);
    }
});

Use "load" event instead of window.onload
Use "load" event instead of window.onload

Other js files may attempt to listen for the window.onload event, the last function assigned would be the one set.
We can use addEventListener to listen for the ``load`` event instead which is the same.

https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event